summaryrefslogtreecommitdiffstats
path: root/abs/core/php/php.install
blob: 0c7e2890b251ba18fa16ff56d08159a13077edee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
post_install() {
  echo '
    ==> PHP modules

    PHP has been built with optional modules. To enable these modules,
    uncomment the modules from php.ini

    Some of them require extra packages to be installed:

        * bz2                : bzip2
        * curl               : curl
        * dba                : gdbm
        * gd                 : libpng, libjpeg, freetype2
        * imap               : pam
        * ldap               : libldap
        * mcrypt             : mcrypt, libtool
        * mysql/mysqli       : libmysqlclient
        * odbc/pdo_odbc      : unixodbc
        * openssl            : openssl
        * pgsql/pdo_pgsql    : postgresql-libs
        * pspell             : aspell
        * snmp               : net-snmp
        * sqlite             : sqlite3
        * tidy               : tidyhtml
        * xsl                : libxslt

    ==> PHP-CGI and FCGI

    There are several cgi relevant settings in your php.ini. Make sure to
    adjust them according to your needs. At least you should activate the
    cgi.fix_pathinfo directive in php.ini by uncommenting it.

    ==> PHP and Apache HTTPD

    To use mod_php with the Apache webserver, add this to your httpd.conf:

        LoadModule php5_module modules/libphp5.so
        [..]
        Include conf/extra/php5_module.conf

    '
}

pre_upgrade() {
  # we moved php.ini from /etc/ to /etc/php
  # lets save the old file before pacman deletes it.
  # can be removed later
  if [ -f /etc/php.ini ] && [ $(vercmp '5.2.4-2' $2) -ge 0 ];then
    echo 'Backing up old php.ini...'
    mv /etc/php.ini /etc/php.ini.pacsave.tmp
  fi
}

post_upgrade() {
  post_install
  echo '
    ==> Review your php.ini

    Your php installation has been updated. You should review your current
    php.ini and check any upstream changes according to the default
    configuration which can be found at php.ini.pacnew.
    '
  # if we upgraded from an installation with old config layout, move the old
  # php.ini to the right place and inform the user about the changes.
  # can be removed later
  if [ -f /etc/php.ini.pacsave.tmp ] && [ $(vercmp '5.2.4-2' $2) -ge 0 ]; then
    echo 'Restoring old php.ini...'
    mv /etc/php/php.ini /etc/php/php.ini.pacnew
    mv /etc/php.ini.pacsave.tmp /etc/php/php.ini
    echo 'Updating extension dir...'
    sed -i -e 's#extension_dir = "/usr/lib/php/extensions/php/"#extension_dir = "/usr/lib/php/20060613/"#g' /etc/php/php.ini
    echo '
    ==> Location of php.ini has changed

    A previous configuration was found at /etc/php.ini. PHP stores its
    configuration at /etc/php/ now. Your old php.ini was moved to
    /etc/php/php.ini. You should merge your old file with the
    default one that can be found at /etc/php/php.ini.pacnew.

    Make sure to enable the modules you need. A lot of them are shared
    objects now and not statically built into php.

    External modules store their configuration in /etc/php/conf.d/. PHP
    scans that directory for any ini files.
    '
  fi
  # be nice to [testing] users and update php.ini to fix bug #8141.
  # can be removed later
  if [ $(vercmp '5.2.4-3' $2) -eq 0 ]; then
    echo 'Updating extension dir...'
    sed -i -e 's#extension_dir = "/usr/lib/php/extensions/"#extension_dir = "/usr/lib/php/20060613/"#g' /etc/php/php.ini
  fi
}

op=$1
shift
[ "$(type -t "$op")" = "function" ] && $op "$@"