[arch-commits] Commit in php/trunk (5 files)

Pierre Schmitz pierre at archlinux.org
Sun Jul 25 11:20:30 UTC 2010


    Date: Sunday, July 25, 2010 @ 07:20:29
  Author: pierre
Revision: 86064

upgpkg: php 5.3.3-1
update to PHP 5.3.3; add fpm sapi

Added:
  php/trunk/php-fpm.conf
  php/trunk/rc.d.php-fpm
Modified:
  php/trunk/PKGBUILD
Deleted:
  php/trunk/db-configure.patch
  php/trunk/mysqlnd_default_port.patch

----------------------------+
 PKGBUILD                   |   88 ++++++++-----
 db-configure.patch         |   51 --------
 mysqlnd_default_port.patch |   23 ---
 php-fpm.conf               |  274 +++++++++++++++++++++++++++++++++++++++++++
 rc.d.php-fpm               |  124 +++++++++++++++++++
 5 files changed, 451 insertions(+), 109 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-07-25 10:18:56 UTC (rev 86063)
+++ PKGBUILD	2010-07-25 11:20:29 UTC (rev 86064)
@@ -5,6 +5,7 @@
 pkgname=('php'
          'php-cgi'
          'php-apache'
+         'php-fpm'
          'php-embed'
          'php-pear'
          'php-curl'
@@ -21,27 +22,26 @@
          'php-sqlite'
          'php-tidy'
          'php-xsl')
-pkgver=5.3.2
-pkgrel=6
-_suhosinver=${pkgver}-0.9.9.1
+pkgver=5.3.3
+pkgrel=1
+_suhosinver=${pkgver}-0.9.10
 arch=('i686' 'x86_64')
 license=('PHP')
 url='http://www.php.net'
 makedepends=('apache' 'imap' 'postgresql-libs' 'mysql' 'libldap' 'postfix'
              'sqlite3' 'unixodbc' 'net-snmp' 'libzip' 'enchant' 'file'
              'libmcrypt' 'tidyhtml' 'aspell' 'libtool' 'gd'  'icu'
-             'curl' 'libxslt' 'openssl' 'bzip2' 'db' 'gmp')
+             'curl' 'libxslt' 'openssl' 'bzip2' 'db' 'gmp' 'libevent')
 options=('!makeflags')
 source=("http://www.php.net/distributions/${pkgbase}-${pkgver}.tar.bz2"
         "http://download.suhosin.org/suhosin-patch-${_suhosinver}.patch.gz"
-        'php.ini.patch' 'apache.conf' 'db-configure.patch'
-        'mysqlnd_default_port.patch')
-md5sums=('46f500816125202c48a458d0133254a4'
-         '4647b05330862d6a1fc4469245cc6ade'
+        'php.ini.patch' 'apache.conf' 'rc.d.php-fpm' 'php-fpm.conf')
+md5sums=('21ceeeb232813c10283a5ca1b4c87b48'
+         'b66b27c43b1332400ef8982944c3b95b'
          'd6f94150f47047882c6716575e12e99b'
          '96ca078be6729b665be8a865535a97bf'
-         'e04e6a3abf327dd40ddb2b7dc21677c4'
-         'bcf06fcc3324f3443d8402008eb1c01f')
+         'ff8346d57f0bd67c7a383c1561dcd7c1'
+         '0ac88ff88ae951118201d6424eaa426a')
 
 build() {
 	# ldap-sasl does not compile with --as-needed
@@ -51,6 +51,7 @@
 	phpconfig="--srcdir=../${pkgbase}-${pkgver} \
 		--prefix=/usr \
 		--sysconfdir=/etc/php \
+		--localstatedir=/var \
 		--with-layout=GNU \
 		--with-config-file-path=/etc/php \
 		--with-config-file-scan-dir=/etc/php/conf.d \
@@ -88,7 +89,7 @@
 		--enable-zip=shared \
 		--with-bz2=shared \
 		--with-curl=shared \
-		--with-db4=shared \
+		--with-db4=/usr \
 		--with-enchant=shared,/usr \
 		--with-freetype-dir=shared,/usr \
 		--with-gd=shared,/usr \
@@ -136,19 +137,12 @@
 
 	cd ${srcdir}/${pkgbase}-${pkgver}
 
-	# avoid linking against old db version
-	patch -p0 -i ${srcdir}/db-configure.patch
-
 	# apply suhosin patch
 	patch -p1 -i ${srcdir}/suhosin-patch-${_suhosinver}.patch
 
 	# adjust paths
 	patch -p0 -i ${srcdir}/php.ini.patch
 
-	# fix http://bugs.php.net/51242
-	# remove for next upstream release
-	patch -p0 -i ${srcdir}/mysqlnd_default_port.patch
-
 	# php
 	mkdir ${srcdir}/build-php
 	cd ${srcdir}/build-php
@@ -165,8 +159,8 @@
 	cp -a ${srcdir}/build-php ${srcdir}/build-cgi
 	cd ${srcdir}/build-cgi
 	./configure ${phpconfig} \
+		--disable-cli \
 		--enable-cgi \
-		--disable-cli \
 		${phpextensions}
 	make
 
@@ -174,8 +168,20 @@
 	cp -a ${srcdir}/build-php ${srcdir}/build-apache
 	cd ${srcdir}/build-apache
 	./configure ${phpconfig} \
+		--disable-cli \
 		--with-apxs2 \
+		${phpextensions}
+	make
+
+	# fpm
+	cp -a ${srcdir}/build-php ${srcdir}/build-fpm
+	cd ${srcdir}/build-fpm
+	./configure ${phpconfig} \
 		--disable-cli \
+		--enable-fpm \
+		--with-libevent-dir=/usr \
+		--with-fpm-user=http \
+		--with-fpm-group=http \
 		${phpextensions}
 	make
 
@@ -183,8 +189,8 @@
 	cp -a ${srcdir}/build-php ${srcdir}/build-embed
 	cd ${srcdir}/build-embed
 	./configure ${phpconfig} \
+		--disable-cli \
 		--enable-embed=shared \
-		--disable-cli \
 		${phpextensions}
 	make
 
@@ -239,6 +245,18 @@
 	install -D -m644 ${srcdir}/apache.conf ${pkgdir}/etc/httpd/conf/extra/php5_module.conf
 }
 
+package_php-fpm() {
+	pkgdesc='FastCGI Process Manager for PHP'
+	depends=('php' 'libevent')
+	backup=('etc/php/php-fpm.conf')
+
+	install -D -m755 ${srcdir}/build-fpm/sapi/fpm/php-fpm ${pkgdir}/usr/sbin/php-fpm
+	install -D -m644 ${srcdir}/build-fpm/sapi/fpm/php-fpm.1 ${pkgdir}/usr/share/man/man1/php-fpm.1
+	install -D -m644 ${srcdir}/php-fpm.conf ${pkgdir}/etc/php/php-fpm.conf
+	install -D -m755 ${srcdir}/rc.d.php-fpm ${pkgdir}/etc/rc.d/php-fpm
+	install -d -m755 ${pkgdir}/var/run/php-fpm
+}
+
 package_php-embed() {
 	pkgdesc='Embed SAPI for PHP'
 	depends=('php' 'pcre' 'libxml2')
@@ -250,7 +268,7 @@
 package_php-pear() {
 	pkgdesc='PHP Extension and Application Repository'
 	depends=('php' 'bash')
-	backup=("etc/php/pear.conf")
+	backup=('etc/php/pear.conf')
 
 	cd ${srcdir}/build-pear
 	make install-pear INSTALL_ROOT=${pkgdir}
@@ -262,87 +280,87 @@
 
 package_php-curl() {
 	depends=('php' 'curl')
-	pkgdesc="curl module for PHP"
+	pkgdesc='curl module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/curl.so ${pkgdir}/usr/lib/php/modules/curl.so
 }
 
 package_php-enchant() {
 	depends=('php' 'enchant')
-	pkgdesc="enchant module for PHP"
+	pkgdesc='enchant module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/enchant.so ${pkgdir}/usr/lib/php/modules/enchant.so
 }
 
 package_php-gd() {
 	depends=('php' 'gd')
-	pkgdesc="gd module for PHP"
+	pkgdesc='gd module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/gd.so ${pkgdir}/usr/lib/php/modules/gd.so
 }
 
 package_php-gmp() {
 	depends=('php' 'gmp')
-	pkgdesc="gmp module for PHP"
+	pkgdesc='gmp module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/gmp.so ${pkgdir}/usr/lib/php/modules/gmp.so
 }
 
 package_php-intl() {
 	depends=('php' 'icu')
-	pkgdesc="intl module for PHP"
+	pkgdesc='intl module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/intl.so ${pkgdir}/usr/lib/php/modules/intl.so
 }
 
 package_php-ldap() {
 	depends=('php' 'libldap')
-	pkgdesc="ldap module for PHP"
+	pkgdesc='ldap module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/ldap.so ${pkgdir}/usr/lib/php/modules/ldap.so
 }
 
 package_php-mcrypt() {
 	depends=('php' 'libmcrypt' 'libtool')
-	pkgdesc="mcrypt module for PHP"
+	pkgdesc='mcrypt module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/mcrypt.so ${pkgdir}/usr/lib/php/modules/mcrypt.so
 }
 
 package_php-odbc() {
 	depends=('php' 'unixodbc')
-	pkgdesc="ODBC modules for PHP"
+	pkgdesc='ODBC modules for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/odbc.so ${pkgdir}/usr/lib/php/modules/odbc.so
 	install -D -m755 ${srcdir}/build-php/modules/pdo_odbc.so ${pkgdir}/usr/lib/php/modules/pdo_odbc.so
 }
 
 package_php-pgsql() {
 	depends=('php' 'postgresql-libs')
-	pkgdesc="PostgreSQL modules for PHP"
+	pkgdesc='PostgreSQL modules for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/pgsql.so ${pkgdir}/usr/lib/php/modules/pgsql.so
 	install -D -m755 ${srcdir}/build-php/modules/pdo_pgsql.so ${pkgdir}/usr/lib/php/modules/pdo_pgsql.so
 }
 
 package_php-pspell() {
 	depends=('php' 'aspell')
-	pkgdesc="pspell module for PHP"
+	pkgdesc='pspell module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/pspell.so ${pkgdir}/usr/lib/php/modules/pspell.so
 }
 
 package_php-snmp() {
 	depends=('php' 'net-snmp')
-	pkgdesc="snmp module for PHP"
+	pkgdesc='snmp module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/snmp.so ${pkgdir}/usr/lib/php/modules/snmp.so
 }
 
 package_php-sqlite() {
 	depends=('php' 'sqlite3')
-	pkgdesc="sqlite3 module for PHP"
+	pkgdesc='sqlite3 module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/sqlite3.so ${pkgdir}/usr/lib/php/modules/sqlite3.so
 	install -D -m755 ${srcdir}/build-php/modules/pdo_sqlite.so ${pkgdir}/usr/lib/php/modules/pdo_sqlite.so
 }
 
 package_php-tidy() {
 	depends=('php' 'tidyhtml')
-	pkgdesc="tidy module for PHP"
+	pkgdesc='tidy module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/tidy.so ${pkgdir}/usr/lib/php/modules/tidy.so
 }
 
 package_php-xsl() {
 	depends=('php' 'libxslt')
-	pkgdesc="xsl module for PHP"
+	pkgdesc='xsl module for PHP'
 	install -D -m755 ${srcdir}/build-php/modules/xsl.so ${pkgdir}/usr/lib/php/modules/xsl.so
 }

Deleted: db-configure.patch
===================================================================
--- db-configure.patch	2010-07-25 10:18:56 UTC (rev 86063)
+++ db-configure.patch	2010-07-25 11:20:29 UTC (rev 86064)
@@ -1,51 +0,0 @@
---- configure	2010-03-03 17:52:37.000000000 +0100
-+++ configure	2010-03-04 15:30:05.254690404 +0100
-@@ -28907,43 +28907,15 @@
-   
-   unset THIS_INCLUDE THIS_LIBS THIS_LFLAGS THIS_PREFIX THIS_RESULT
- 
--  dbdp="/usr/local/BerkeleyDB.4."
--  for i in $PHP_DB4 ${dbdp}6 ${dbdp}5 ${dbdp}4 ${dbdp}3  ${dbdp}2 ${dbdp}1 ${dbdp}0 /usr/local /usr; do
--    if test -f "$i/db4/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/db4/db.h
--      break
--    elif test -f "$i/include/db4.6/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.6/db.h
--      break
--    elif test -f "$i/include/db4.5/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.5/db.h
--      break
--    elif test -f "$i/include/db4/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4/db.h
--      break
--    elif test -f "$i/include/db/db4.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db/db4.h
--      break
--    elif test -f "$i/include/db4.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db4.h
--      break
--    elif test -f "$i/include/db.h"; then
--      THIS_PREFIX=$i
--      THIS_INCLUDE=$i/include/db.h
--      break
--    fi
--  done
-+  if test -f "/usr/include/db.h"; then
-+    THIS_PREFIX=/usr
-+    THIS_INCLUDE=/usr/include/db.h
-+  fi
-   
-   if test -z "$THIS_INCLUDE"; then
-     { echo "configure: error: DBA: Could not find necessary header file(s)." 1>&2; exit 1; }
-   fi
--  for LIB in db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db; do
-+  for LIB in db; do
-     if test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.a || test -f $THIS_PREFIX/$PHP_LIBDIR/lib$LIB.$SHLIB_SUFFIX_NAME; then
-       lib_found="";
-       

Deleted: mysqlnd_default_port.patch
===================================================================
--- mysqlnd_default_port.patch	2010-07-25 10:18:56 UTC (rev 86063)
+++ mysqlnd_default_port.patch	2010-07-25 11:20:29 UTC (rev 86064)
@@ -1,23 +0,0 @@
---- ext/mysqlnd/mysqlnd.c	2010-03-09 09:39:20.000000000 +0100
-+++ ext/mysqlnd/mysqlnd.c	2010-03-09 09:00:40.000000000 +0100
-@@ -527,9 +527,6 @@
- 		db = "";
- 		db_len = 0;
- 	}
--	if (!port && !socket) {
--		port = 3306;
--	}
- 	host_len = strlen(host);
- #ifndef PHP_WIN32
- 	if (host_len == sizeof("localhost") - 1 && !strncasecmp(host, "localhost", host_len)) {
-@@ -541,6 +538,10 @@
- 	} else
- #endif
- 	{
-+		if (!port) {
-+			port = 3306;
-+		}
-+
- 		transport_len = spprintf(&transport, 0, "tcp://%s:%d", host, port);
- 	}
- 	DBG_INF_FMT("transport=%s", transport);

Added: php-fpm.conf
===================================================================
--- php-fpm.conf	                        (rev 0)
+++ php-fpm.conf	2010-07-25 11:20:29 UTC (rev 86064)
@@ -0,0 +1,274 @@
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+; All relative paths in this configuration file are relative to PHP's install
+; prefix.
+
+; Include one or more files. If glob(3) exists, it is used to include a bunch of
+; files from a glob(3) pattern. This directive can be used everywhere in the
+; file.
+;include=/etc/php/fpm.d/*.conf
+
+;;;;;;;;;;;;;;;;;;
+; Global Options ;
+;;;;;;;;;;;;;;;;;;
+
+[global]
+; Pid file
+; Default Value: none
+pid = /var/run/php-fpm/php-fpm.pid
+
+; Error log file
+; Default Value: /var/log/php-fpm.log
+;error_log = /var/log/php-fpm.log
+
+; Log level
+; Possible Values: alert, error, warning, notice, debug
+; Default Value: notice
+;log_level = notice
+
+; If this number of child processes exit with SIGSEGV or SIGBUS within the time
+; interval set by emergency_restart_interval then FPM will restart. A value
+; of '0' means 'Off'.
+; Default Value: 0
+;emergency_restart_threshold = 0
+
+; Interval of time used by emergency_restart_interval to determine when 
+; a graceful restart will be initiated.  This can be useful to work around
+; accidental corruptions in an accelerator's shared memory.
+; Available Units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;emergency_restart_interval = 0
+
+; Time limit for child processes to wait for a reaction on signals from master.
+; Available units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;process_control_timeout = 0
+
+; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
+; Default Value: yes
+;daemonize = yes
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ; 
+;;;;;;;;;;;;;;;;;;;;
+
+; Multiple pools of child processes may be started with different listening
+; ports and different management options.  The name of the pool will be
+; used in logs and stats. There is no limitation on the number of pools which
+; FPM can handle. Your system will tell you anyway :)
+
+; Start a new pool named 'www'.
+[www]
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
+;                            a specific port;
+;   'port'                 - to listen on a TCP socket to all addresses on a
+;                            specific port;
+;   '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+;listen = 127.0.0.1:9000
+listen = /var/run/php-fpm/php-fpm.sock
+
+; Set listen(2) backlog. A value of '-1' means unlimited.
+; Default Value: -1
+;listen.backlog = -1
+ 
+; List of ipv4 addresses of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; 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 = http
+listen.group = http
+listen.mode = 0660
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+;       will be used.
+user = http
+group = http
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+;   static  - a fixed number (pm.max_children) of child processes;
+;   dynamic - the number of child processes are set dynamically based on the
+;             following directives:
+;             pm.max_children      - the maximum number of children that can
+;                                    be alive at the same time.
+;             pm.start_servers     - the number of children created on startup.
+;             pm.min_spare_servers - the minimum number of children in 'idle'
+;                                    state (waiting to process). If the number
+;                                    of 'idle' processes is less than this
+;                                    number then some children will be created.
+;             pm.max_spare_servers - the maximum number of children in 'idle'
+;                                    state (waiting to process). If the number
+;                                    of 'idle' processes is greater than this
+;                                    number then some children will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes to be created when pm is set to 'dynamic'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI.
+; Note: Used when pm is set to either 'static' or 'dynamic'
+; Note: This value is mandatory.
+pm.max_children = 50
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 20
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 5
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 35
+ 
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. By default, the status page shows the following
+; information:
+;   accepted conn    - the number of request accepted by the pool;
+;   pool             - the name of the pool;
+;   process manager  - static or dynamic;
+;   idle processes   - the number of idle processes;
+;   active processes - the number of active processes;
+;   total processes  - the number of idle + active processes.
+; The values of 'idle processes', 'active processes' and 'total processes' are
+; updated each second. The value of 'accepted conn' is updated in real time.
+; Example output:
+;   accepted conn:   12073
+;   pool:             www
+;   process manager:  static
+;   idle processes:   35
+;   active processes: 65
+;   total processes:  100
+; By default the status page output is formatted as text/plain. Passing either
+; 'html' or 'json' as a query string will return the corresponding output
+; syntax. Example:
+;   http://www.foo.bar/status
+;   http://www.foo.bar/status?json
+;   http://www.foo.bar/status?html
+; Note: The value must start with a leading slash (/). The value can be
+;       anything, but it may not be a good idea to use the .php extension or it
+;       may conflict with a real PHP file.
+; Default Value: not set 
+;pm.status_path = /status
+ 
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+;       anything, but it may not be a good idea to use the .php extension or it
+;       may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+ 
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+ 
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+ 
+; The log file for slow requests
+; Default Value: /var/log/php-fpm.log.slow
+;slowlog = /var/log/php-fpm.log.slow
+ 
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+ 
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+ 
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: chrooting is a great security feature and should be used whenever 
+;       possible. However, all PHP paths will be relative to the chroot
+;       (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot = 
+ 
+; Chdir to this directory at the start. This value must be an absolute path.
+; Default Value: current directory or / when chroot
+;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.
+; Default Value: no
+;catch_workers_output = yes
+ 
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+;   php_value/php_flag             - you can set classic ini defines which can
+;                                    be overwritten from PHP call 'ini_set'. 
+;   php_admin_value/php_admin_flag - these directives won't be overwritten by
+;                                     PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Default Value: nothing is defined by default except the values in php.ini and
+;                specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www at my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M

Added: rc.d.php-fpm
===================================================================
--- rc.d.php-fpm	                        (rev 0)
+++ rc.d.php-fpm	2010-07-25 11:20:29 UTC (rev 86064)
@@ -0,0 +1,124 @@
+#!/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
+
+}
+
+[ -d /var/run/php-fpm ] || install -d -m755 /var/run/php-fpm
+
+case "$1" in
+	start)
+		stat_busy 'Starting php-fpm'
+
+		/usr/sbin/php-fpm
+
+		if [ "$?" != 0 ] ; then
+			stat_fail
+			exit 1
+		fi
+
+		wait_for_pid created /var/run/php-fpm/php-fpm.pid
+
+		if [ -n "$try" ] ; then
+			stat_fail
+			exit 1
+		else
+			add_daemon php-fpm
+			stat_done
+		fi
+	;;
+
+	stop)
+		stat_busy 'Gracefully shutting down php-fpm'
+
+		if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then
+			stat_fail
+			exit 1
+		fi
+
+		kill -QUIT `cat /var/run/php-fpm/php-fpm.pid`
+
+		wait_for_pid removed /var/run/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 /var/run/php-fpm/php-fpm.pid ] ; then
+			stat_fail
+			exit 1
+		fi
+
+		kill -TERM `cat /var/run/php-fpm/php-fpm.pid`
+
+		wait_for_pid removed /var/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)
+		stat_busy 'Reload service php-fpm'
+
+		if [ ! -r /var/run/php-fpm/php-fpm.pid ] ; then
+			stat_fail
+			exit 1
+		fi
+
+		kill -USR2 `cat /var/run/php-fpm/php-fpm.pid`
+		stat_done
+	;;
+
+	*)
+		echo "usage: $0 {start|stop|force-quit|restart|reload}"
+		exit 1
+	;;
+
+esac




More information about the arch-commits mailing list