summaryrefslogtreecommitdiffstats
path: root/abs/core/php
diff options
context:
space:
mode:
Diffstat (limited to 'abs/core/php')
-rw-r--r--abs/core/php/__changelog16
-rw-r--r--abs/core/php/apache.conf10
-rw-r--r--abs/core/php/db4-test.patch11
-rw-r--r--abs/core/php/logrotate.d.php-fpm8
-rw-r--r--abs/core/php/php-fpm.conf.in.patch52
-rw-r--r--abs/core/php/php-fpm.install9
-rw-r--r--abs/core/php/php-fpm.service13
-rw-r--r--abs/core/php/php-fpm.tmpfiles1
-rw-r--r--abs/core/php/php.ini.patch122
-rw-r--r--abs/core/php/php.install75
-rw-r--r--abs/core/php/rc.d.php-fpm144
11 files changed, 357 insertions, 104 deletions
diff --git a/abs/core/php/__changelog b/abs/core/php/__changelog
index 754dc7c..b3123e3 100644
--- a/abs/core/php/__changelog
+++ b/abs/core/php/__changelog
@@ -1,15 +1 @@
-modified php.ini
-set base dir to /data/srv/httpd/htdocs
-added /data/srv/tmp to basedir
-added /usr/share/mythtv/mythweather/scripts/
-send errors to stderr
-change .install file, timezone is modified on install
-php.ini -jm
- remove open_basedir
-
-split package into "php" "php-cgi" and "php-pear" -mh
-php-pear replaces PearLog -mh
-
-php.ini: mysql.default_socket = /var/run/mysqld/mysqld.sock Ref #753 -mh
-
-php.install: Change mysql.default_socket
+removed postfix for now as it doesn't compile
diff --git a/abs/core/php/apache.conf b/abs/core/php/apache.conf
index 86344c8..c3ca0aa 100644
--- a/abs/core/php/apache.conf
+++ b/abs/core/php/apache.conf
@@ -3,7 +3,11 @@
<IfModule dir_module>
<IfModule php5_module>
DirectoryIndex index.php index.html
- AddHandler application/x-httpd-php .php
- AddHandler application/x-httpd-php-source .phps
+ <FilesMatch "\.php$">
+ SetHandler application/x-httpd-php
+ </FilesMatch>
+ <FilesMatch "\.phps$">
+ SetHandler application/x-httpd-php-source
+ </FilesMatch>
</IfModule>
-</IfModule> \ No newline at end of file
+</IfModule>
diff --git a/abs/core/php/db4-test.patch b/abs/core/php/db4-test.patch
deleted file mode 100644
index 2c0cb14..0000000
--- a/abs/core/php/db4-test.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure 2010-07-21 12:53:06.000000000 +0200
-+++ configure 2010-10-22 09:21:54.077666560 +0200
-@@ -30742,7 +30742,7 @@
- #include "confdefs.h"
-
- #include "$THIS_INCLUDE"
--#if DB_VERSION_MINOR != 1 || (DB_VERSION_MINOR == 1 && DB_VERSION_PATCH >= 25)
-+#if DB_VERSION_MAJOR == 5 || DB_VERSION_MINOR != 1 || (DB_VERSION_MINOR == 1 && DB_VERSION_PATCH >= 25)
- yes
- #endif
-
diff --git a/abs/core/php/logrotate.d.php-fpm b/abs/core/php/logrotate.d.php-fpm
new file mode 100644
index 0000000..ac2d92a
--- /dev/null
+++ b/abs/core/php/logrotate.d.php-fpm
@@ -0,0 +1,8 @@
+/var/log/php-fpm.log {
+ missingok
+ notifempty
+ delaycompress
+ postrotate
+ kill -USR1 `cat /run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
+ endscript
+}
diff --git a/abs/core/php/php-fpm.conf.in.patch b/abs/core/php/php-fpm.conf.in.patch
new file mode 100644
index 0000000..0b17182
--- /dev/null
+++ b/abs/core/php/php-fpm.conf.in.patch
@@ -0,0 +1,52 @@
+--- sapi/fpm/php-fpm.conf.in 2011-10-08 23:04:10.000000000 +0200
++++ sapi/fpm/php-fpm.conf.in 2012-03-01 19:50:48.549947258 +0100
+@@ -12,7 +12,7 @@
+ ; Relative path can also be used. They will be prefixed by:
+ ; - the global prefix if it's been set (-p arguement)
+ ; - @prefix@ otherwise
+-;include=etc/fpm.d/*.conf
++;include=/etc/php/fpm.d/*.conf
+
+ ;;;;;;;;;;;;;;;;;;
+ ; Global Options ;
+@@ -22,7 +22,7 @@
+ ; Pid file
+ ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@
+ ; Default Value: none
+-;pid = run/php-fpm.pid
++pid = /run/php-fpm/php-fpm.pid
+
+ ; Error log file
+ ; If it's set to "syslog", log is sent to syslogd instead of being written
+@@ -140,7 +140,8 @@
+ ; specific port;
+ ; '/path/to/unix/socket' - to listen on a unix socket.
+ ; Note: This value is mandatory.
+-listen = 127.0.0.1:9000
++;listen = 127.0.0.1:9000
++listen = /run/php-fpm/php-fpm.sock
+
+ ; Set listen(2) backlog.
+ ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
+@@ -151,9 +152,9 @@
+ ; BSD-derived systems allow connections regardless of permissions.
+ ; Default Values: user and group are set as the running user
+ ; mode is set to 0666
+-;listen.owner = @php_fpm_user@
+-;listen.group = @php_fpm_group@
+-;listen.mode = 0666
++listen.owner = @php_fpm_user@
++listen.group = @php_fpm_group@
++listen.mode = 0660
+
+ ; List of ipv4 addresses of FastCGI clients which are allowed to connect.
+ ; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+@@ -442,7 +443,7 @@
+ ; Chdir to this directory at the start.
+ ; Note: relative path can be used.
+ ; Default Value: current directory or / when chroot
+-;chdir = /var/www
++;chdir = /srv/http
+
+ ; Redirect worker stdout and stderr into main error log. If not set, stdout and
+ ; stderr will be redirected to /dev/null according to FastCGI specs.
diff --git a/abs/core/php/php-fpm.install b/abs/core/php/php-fpm.install
new file mode 100644
index 0000000..41fc37c
--- /dev/null
+++ b/abs/core/php/php-fpm.install
@@ -0,0 +1,9 @@
+post_install() {
+ if [[ ! -d run/php-fpm ]]; then
+ usr/bin/systemd-tmpfiles --create usr/lib/tmpfiles.d/php-fpm.conf
+ fi
+}
+
+post_upgrade() {
+ post_install
+}
diff --git a/abs/core/php/php-fpm.service b/abs/core/php/php-fpm.service
new file mode 100644
index 0000000..e29f7c2
--- /dev/null
+++ b/abs/core/php/php-fpm.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=FastCGI Process Manager for PHP
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/run/php-fpm/php-fpm.pid
+PrivateTmp=true
+ExecStart=/usr/sbin/php-fpm
+ExecReload=/bin/kill -USR2 $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/abs/core/php/php-fpm.tmpfiles b/abs/core/php/php-fpm.tmpfiles
new file mode 100644
index 0000000..801e74f
--- /dev/null
+++ b/abs/core/php/php-fpm.tmpfiles
@@ -0,0 +1 @@
+d /run/php-fpm 755 root root
diff --git a/abs/core/php/php.ini.patch b/abs/core/php/php.ini.patch
new file mode 100644
index 0000000..bbaae21
--- /dev/null
+++ b/abs/core/php/php.ini.patch
@@ -0,0 +1,122 @@
+--- php.ini-production 2012-03-29 06:17:59.000000000 +0200
++++ php.ini-production 2012-03-30 10:46:21.181340861 +0200
+@@ -305,7 +305,7 @@
+ ; or per-virtualhost web server configuration file. This directive is
+ ; *NOT* affected by whether Safe Mode is turned On or Off.
+ ; http://php.net/open-basedir
+-;open_basedir =
++open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/
+
+ ; This directive allows you to disable certain functions for security reasons.
+ ; It receives a comma-delimited list of function names. This directive is
+@@ -702,7 +702,7 @@
+ ;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ ; UNIX: "/path1:/path2"
+-;include_path = ".:/php/includes"
++include_path = ".:/usr/share/pear"
+ ;
+ ; Windows: "\path1;\path2"
+ ;include_path = ".;c:\php\includes"
+@@ -725,7 +725,7 @@
+
+ ; Directory in which the loadable extensions (modules) reside.
+ ; http://php.net/extension-dir
+-; extension_dir = "./"
++extension_dir = "/usr/lib/php/modules/"
+ ; On windows:
+ ; extension_dir = "ext"
+
+@@ -859,51 +859,47 @@
+ ; If you only provide the name of the extension, PHP will look for it in its
+ ; default extension directory.
+ ;
+-; Windows Extensions
+-; Note that ODBC support is built in, so no dll is needed for it.
+-; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
+-; extension folders as well as the separate PECL DLL download (PHP 5).
+-; Be sure to appropriately set the extension_dir directive.
+-;
+-;extension=php_bz2.dll
+-;extension=php_curl.dll
+-;extension=php_fileinfo.dll
+-;extension=php_gd2.dll
+-;extension=php_gettext.dll
+-;extension=php_gmp.dll
+-;extension=php_intl.dll
+-;extension=php_imap.dll
+-;extension=php_interbase.dll
+-;extension=php_ldap.dll
+-;extension=php_mbstring.dll
+-;extension=php_exif.dll ; Must be after mbstring as it depends on it
+-;extension=php_mysql.dll
+-;extension=php_mysqli.dll
+-;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
+-;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
+-;extension=php_openssl.dll
+-;extension=php_pdo_firebird.dll
+-;extension=php_pdo_mysql.dll
+-;extension=php_pdo_oci.dll
+-;extension=php_pdo_odbc.dll
+-;extension=php_pdo_pgsql.dll
+-;extension=php_pdo_sqlite.dll
+-;extension=php_pgsql.dll
+-;extension=php_pspell.dll
+-;extension=php_shmop.dll
+-
+-; The MIBS data available in the PHP distribution must be installed.
+-; See http://www.php.net/manual/en/snmp.installation.php
+-;extension=php_snmp.dll
+-
+-;extension=php_soap.dll
+-;extension=php_sockets.dll
+-;extension=php_sqlite3.dll
+-;extension=php_sybase_ct.dll
+-;extension=php_tidy.dll
+-;extension=php_xmlrpc.dll
+-;extension=php_xsl.dll
+-;extension=php_zip.dll
++;extension=bcmath.so
++;extension=bz2.so
++;extension=calendar.so
++extension=curl.so
++;extension=dba.so
++;extension=enchant.so
++;extension=exif.so
++;extension=ftp.so
++;extension=gd.so
++extension=gettext.so
++;extension=gmp.so
++;extension=iconv.so
++;extension=imap.so
++;extension=intl.so
++;extension=ldap.so
++;extension=mcrypt.so
++;extension=mssql.so
++;extension=mysqli.so
++;extension=mysql.so
++;extension=odbc.so
++;extension=openssl.so
++;extension=pdo_mysql.so
++;extension=pdo_odbc.so
++;extension=pdo_pgsql.so
++;extension=pdo_sqlite.so
++;extension=pgsql.so
++;extension=phar.so
++;extension=posix.so
++;extension=pspell.so
++;extension=shmop.so
++;extension=snmp.so
++;extension=soap.so
++;extension=sockets.so
++;extension=sqlite3.so
++;extension=sysvmsg.so
++;extension=sysvsem.so
++;extension=sysvshm.so
++;extension=tidy.so
++;extension=xmlrpc.so
++;extension=xsl.so
++;extension=zip.so
+
+ ;;;;;;;;;;;;;;;;;;;
+ ; Module Settings ;
diff --git a/abs/core/php/php.install b/abs/core/php/php.install
deleted file mode 100644
index b040032..0000000
--- a/abs/core/php/php.install
+++ /dev/null
@@ -1,75 +0,0 @@
-post_install() {
- # change mysql.default_socket for mythweb
- sed -i 's/^mysql.default_socket.*$/mysql.default_socket = \/var\/run\/mysqld\/mysqld.sock/g' /etc/php/php.ini
- if [ -f /etc/systemconfig ]
- then
- . /etc/systemconfig
- if [ -f /etc/php/php.ini ]
- then
- sed -i 's|^.*date.timezone.*$|date.timezone='${timezone}'|' /etc/php/php.ini
- fi
- fi
-}
-
-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
- if [ -f /etc/systemconfig ]
- then
- . /etc/systemconfig
- if [ -f /etc/php/php.ini ]
- then
- sed -i 's|^.*date.timezone.*$|date.timezone='${timezone}'|' /etc/php/php.ini
- fi
- fi
- echo 'Updating extension dir...'
- sed -i -e 's/#extension_dir = "/usr/lib/php/20060613/"/#extension_dir = "/usr/lib/php/modules/"#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 "$@"
diff --git a/abs/core/php/rc.d.php-fpm b/abs/core/php/rc.d.php-fpm
new file mode 100644
index 0000000..47f0886
--- /dev/null
+++ b/abs/core/php/rc.d.php-fpm
@@ -0,0 +1,144 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+
+wait_for_pid () {
+ try=0
+ while test $try -lt 35 ; do
+ case "$1" in
+ 'created')
+ if [ -f "$2" ] ; then
+ try=''
+ break
+ fi
+ ;;
+ 'removed')
+ if [ ! -f "$2" ] ; then
+ try=''
+ break
+ fi
+ ;;
+ esac
+
+ stat_append '.'
+ try=`expr $try + 1`
+ sleep 1
+ done
+}
+
+test_config() {
+ stat_busy 'Checking configuration'
+ if [ $(id -u) -ne 0 ]; then
+ stat_append '(This script must be run as root)'
+ stat_die
+ fi
+
+ if [ ! -r /etc/php/php-fpm.conf ]; then
+ stat_append '(/etc/php/php-fpm.conf not found)'
+ stat_die
+ fi
+
+ local test=$(/usr/sbin/php-fpm -t 2>&1)
+ if [ $? -gt 0 ]; then
+ stat_append '(error in /etc/php/php-fpm.conf)'
+ stat_die
+ elif echo $test | grep -qi 'error'; then
+ stat_append '(error in /etc/php/php.ini)'
+ stat_die
+ fi
+
+ stat_done
+}
+
+case "$1" in
+ start)
+ test_config
+ stat_busy 'Starting php-fpm'
+
+ /usr/sbin/php-fpm
+
+ if [ "$?" != 0 ] ; then
+ stat_fail
+ exit 1
+ fi
+
+ wait_for_pid created /run/php-fpm/php-fpm.pid
+
+ if [ -n "$try" ] ; then
+ stat_fail
+ exit 1
+ else
+ add_daemon php-fpm
+ stat_done
+ fi
+ ;;
+
+ stop)
+ test_config
+ stat_busy 'Gracefully shutting down php-fpm'
+
+ if [ ! -r /run/php-fpm/php-fpm.pid ] ; then
+ stat_fail
+ exit 1
+ fi
+
+ kill -QUIT `cat /run/php-fpm/php-fpm.pid`
+
+ wait_for_pid removed /run/php-fpm/php-fpm.pid
+
+ if [ -n "$try" ] ; then
+ stat_fail
+ exit 1
+ else
+ rm_daemon php-fpm
+ stat_done
+ fi
+ ;;
+
+ force-quit)
+ stat_busy 'Terminating php-fpm'
+
+ if [ ! -r /run/php-fpm/php-fpm.pid ] ; then
+ stat_fail
+ exit 1
+ fi
+
+ kill -TERM `cat /run/php-fpm/php-fpm.pid`
+
+ wait_for_pid removed /run/php-fpm/php-fpm.pid
+
+ if [ -n "$try" ] ; then
+ stat_fail
+ exit 1
+ else
+ rm_daemon php-fpm
+ stat_done
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ reload)
+ test_config
+ stat_busy 'Reload service php-fpm'
+
+ if [ ! -r /run/php-fpm/php-fpm.pid ] ; then
+ stat_fail
+ exit 1
+ fi
+
+ kill -USR2 `cat /run/php-fpm/php-fpm.pid`
+ stat_done
+ ;;
+
+ *)
+ echo "usage: $0 {start|stop|force-quit|restart|reload|logrotate}"
+ exit 1
+ ;;
+
+esac