tony2001 Mon, 14 Dec 2009 11:57:21 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=292129
Log:
drop conf/ and man/
simplify config.m4 a bit
fix exec_prefix issue
Changed paths:
_U php/php-src/branches/PHP_5_3_FPM/sapi/fpm/
U php/php-src/branches/PHP_5_3_FPM/sapi/fpm/Makefile.frag
D php/php-src/branches/PHP_5_3_FPM/sapi/fpm/conf/
U php/php-src/branches/PHP_5_3_FPM/sapi/fpm/config.m4
A php/php-src/branches/PHP_5_3_FPM/sapi/fpm/init.d.php-fpm.in
D php/php-src/branches/PHP_5_3_FPM/sapi/fpm/man/
A php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.1.in
A php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.conf.in
Property changes on: php/php-src/branches/PHP_5_3_FPM/sapi/fpm
___________________________________________________________________
Modified: svn:ignore
- .deps
.libs
php-fpm
php-fpm.1
+ .deps
.libs
php-fpm
php-fpm.1
init.d.php-fpm
php-fpm.conf
Modified: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/Makefile.frag
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/Makefile.frag 2009-12-14 10:56:34 UTC (rev 292128)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/Makefile.frag 2009-12-14 11:57:21 UTC (rev 292129)
@@ -17,7 +17,7 @@
@echo "Installing PHP FPM config: $(INSTALL_ROOT)$(php_fpm_conf_dir)/" && \
$(mkinstalldirs) $(INSTALL_ROOT)$(php_fpm_conf_dir) || :
- @$(INSTALL_DATA) sapi/fpm/conf/php-fpm.conf $(INSTALL_ROOT)$(php_fpm_conf_dir)/php-fpm.conf.default || :
+ @$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(php_fpm_conf_dir)/php-fpm.conf.default || :
@echo "Installing PHP FPM man page: $(INSTALL_ROOT)$(mandir)/man1/"
@$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man1
Modified: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/config.m4
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/config.m4 2009-12-14 10:56:34 UTC (rev 292128)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/config.m4 2009-12-14 11:57:21 UTC (rev 292129)
@@ -539,7 +539,7 @@
fi
if test -z "$exec_prefix" -o "$exec_prefix" = "NONE"; then
- exec_prefix="/usr/local"
+ exec_prefix=`eval echo "$prefix"`
fi
php_fpm_bin_path=`eval echo "$bindir"`
@@ -606,21 +606,6 @@
])
-
-AC_DEFUN([AC_FPM_OUTPUT],
-[
- PHP_OUTPUT(sapi/fpm/conf/php-fpm.conf:sapi/fpm/conf/php-fpm.conf.in)
- PHP_OUTPUT(sapi/fpm/conf/init.d.php-fpm:sapi/fpm/conf/init.d.php-fpm.in)
- PHP_OUTPUT(sapi/fpm/php-fpm.1:sapi/fpm/man/php-fpm.1.in)
-])
-
-
-AC_DEFUN([AC_FPM_CONF],
-[
- AC_FPM_ARGS
- AC_FPM_VARS
- AC_FPM_OUTPUT
-])
dnl }}}
@@ -646,8 +631,10 @@
])
AC_FPM_CHECKS
- AC_FPM_CONF
+ AC_FPM_ARGS
+ AC_FPM_VARS
+ PHP_OUTPUT(sapi/fpm/php-fpm.conf sapi/fpm/init.d.php-fpm sapi/fpm/php-fpm.1)
PHP_ADD_MAKEFILE_FRAGMENT([$abs_srcdir/sapi/fpm/Makefile.frag], [$abs_srcdir/sapi/fpm], [sapi/fpm])
SAPI_FPM_PATH=sapi/fpm/php-fpm
Added: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/init.d.php-fpm.in
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/init.d.php-fpm.in (rev 0)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/init.d.php-fpm.in 2009-12-14 11:57:21 UTC (rev 292129)
@@ -0,0 +1,135 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides: php-fpm
+# Required-Start: $all
+# Required-Stop: $all
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: starts php-fpm
+# Description: starts the PHP FastCGI Process Manager daemon
+### END INIT INFO
+
+php_fpm_b...@php_fpm_bin_path@
+php_fpm_co...@php_fpm_conf_path@
+php_fpm_p...@php_fpm_pid_path@
+
+
+php_opts="--fpm-config $php_fpm_CONF"
+
+
+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
+
+ echo -n .
+ try=`expr $try + 1`
+ sleep 1
+
+ done
+
+}
+
+case "$1" in
+ start)
+ echo -n "Starting php-fpm "
+
+ $php_fpm_BIN $php_opts
+
+ if [ "$?" != 0 ] ; then
+ echo " failed"
+ exit 1
+ fi
+
+ wait_for_pid created $php_fpm_PID
+
+ if [ -n "$try" ] ; then
+ echo " failed"
+ exit 1
+ else
+ echo " done"
+ fi
+ ;;
+
+ stop)
+ echo -n "Gracefully shutting down php-fpm "
+
+ if [ ! -r $php_fpm_PID ] ; then
+ echo "warning, no pid file found - php-fpm is not running ?"
+ exit 1
+ fi
+
+ kill -QUIT `cat $php_fpm_PID`
+
+ wait_for_pid removed $php_fpm_PID
+
+ if [ -n "$try" ] ; then
+ echo " failed. Use force-exit"
+ exit 1
+ else
+ echo " done"
+ fi
+ ;;
+
+ force-quit)
+ echo -n "Terminating php-fpm "
+
+ if [ ! -r $php_fpm_PID ] ; then
+ echo "warning, no pid file found - php-fpm is not running ?"
+ exit 1
+ fi
+
+ kill -TERM `cat $php_fpm_PID`
+
+ wait_for_pid removed $php_fpm_PID
+
+ if [ -n "$try" ] ; then
+ echo " failed"
+ exit 1
+ else
+ echo " done"
+ fi
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+
+ reload)
+
+ echo -n "Reload service php-fpm "
+
+ if [ ! -r $php_fpm_PID ] ; then
+ echo "warning, no pid file found - php-fpm is not running ?"
+ exit 1
+ fi
+
+ kill -USR2 `cat $php_fpm_PID`
+
+ echo " done"
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|force-quit|restart|reload}"
+ exit 1
+ ;;
+
+esac
Added: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.1.in
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.1.in (rev 0)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.1.in 2009-12-14 11:57:21 UTC (rev 292129)
@@ -0,0 +1,186 @@
+.TH PHP-FPM 1 "2009" "The PHP Group" "Scripting Language"
+.SH NAME
+.TP 15
+...@php_fpm_bin@ \- PHP FastCGI Process Manager 'PHP-FPM'
+.SH SYNOPSIS
+.B @php_fpm_bin@
+[options]
+.LP
+.SH DESCRIPTION
+\fBPHP\fP is a widely\-used general\-purpose scripting language that is especially suited for
+Web development and can be embedded into HTML. This is a variant of PHP that will run in the background as a daemon, listening for CGI requests. Output is logged to @php_fpm_log_p...@.
+.LP
+Most options are set in the configuration file. The configuration file is @php_fpm_conf_p...@. By default, @php_fpm_bin@ will respond to CGI requests listening on localhost http port 9000. Therefore @php_fpm_bin@ expects your webserver to forward all requests for '.php' files to port 9000 and you should edit your webserver configuration file appropriately.
+.SH OPTIONS
+.TP 15
+.B \-C
+Do not chdir to the script's directory
+.TP
+.PD 0
+.B \-\-php\-ini \fIpath\fP|\fIfile\fP
+.TP
+.PD 1
+.B \-c \fIpath\fP|\fIfile\fP
+Look for
+.B php.ini
+file in the directory
+.IR path
+or use the specified
+.IR file
+.TP
+.PD 0
+.B \-\-no\-php\-ini
+.TP
+.PD 1
+.B \-n
+No
+.B php.ini
+file will be used
+.TP
+.PD 0
+.B \-\-define \fIfoo\fP[=\fIbar\fP]
+.TP
+.PD 1
+.B \-d \fIfoo\fP[=\fIbar\fP]
+Define INI entry
+.IR foo
+with value
+.IR bar
+.TP
+.B \-e
+Generate extended information for debugger/profiler
+.TP
+.PD 0
+.B \-\-help
+.TP
+.PD 1
+.B \-h
+This help
+.TP
+.PD 0
+.B \-\-info
+.TP
+.PD 1
+.B \-i
+PHP information and configuration
+.TP
+.PD 0
+.B \-\-modules
+.TP
+.PD 1
+.B \-m
+Show compiled in modules
+.TP
+.PD 0
+.B \-\-version
+.TP
+.PD 1
+.B \-v
+Version number
+.TP
+.PD 0
+.B \-\-fpm\-config \fIfile\fP
+.TP
+.PD 1
+.B \-\-y
+Specify alternative path to FastCGI process manager configuration file (the default is @php_fpm_conf_path@)
+.TP
+.PD 0
+.B \-\-zend\-extension \fIfile\fP
+.TP
+.PD 1
+.B \-z \fIfile\fP
+Load Zend extension
+.IR file
+.SH FILES
+.TP 15
+.B @[email protected]
+The configuration file for the @php_fpm_bin@ daemon.
+.TP
+.B php.ini
+The standard php configuration file.
+.SH EXAMPLES
+You should use the init script provided to start and stop the @php_fpm_bin@ daemon. This situation applies for any unix systems which use init.d for their main process manager.
+.P
+.PD 1
+.RS
+sudo /etc/init.d/@php_fpm_bin@ start
+.RE
+.TP
+If your installation has no appropriate init script, launch @php_fpm_bin_path@ with no arguments. It will launch as a daemon (background process) by default. The file @php_fpm_pid_path@ determines whether @php_fpm_bin@ is already up and running. Once started, @php_fpm_bin@ then responds to several POSIX signals:
+.P
+.PD 0
+.RS
+.B SIGINT,SIGTERM \fPimmediate termination
+.TP
+.B SIGQUIT \fPgraceful stop
+.TP
+.B SIGUSR1 \fPre-open log file
+.TP
+.B SIGUSR2 \fPgraceful reload of all workers + reload of fpm conf/binary
+.RE
+.PD 1
+.P
+.SH TIPS
+The PHP-FPM CGI daemon will work well with most popular webservers, including Apache2, lighttpd and nginx.
+.PD 1
+.P
+.SH SEE ALSO
+The PHP-FPM website:
+.PD 0
+.P
+.B http://php-fpm.org
+.PD 1
+.P
+For a more or less complete description of PHP look here:
+.PD 0
+.P
+.B http://www.php.net/manual/
+.PD 1
+.P
+A nice introduction to PHP by Stig Bakken can be found here:
+.PD 0
+.P
+.B http://www.zend.com/zend/art/intro.php
+.PD 1
+.SH BUGS
+You can view the list of known bugs or report any new bug you
+found at:
+.PD 0
+.P
+.B http://bugs.php.net
+.PD 1
+.SH AUTHORS
+PHP-FPM SAPI was written by Andrei Nigmatulin. The mailing-lists are highload-php-en (English) and highload-php-ru (Russian).
+.P
+The PHP Group: Thies C. Arntzen, Stig Bakken, Andi Gutmans, Rasmus Lerdorf, Sam Ruby, Sascha Schumann, Zeev Suraski, Jim Winstead, Andrei Zmievski.
+.P
+A List of active developers can be found here:
+.PD 0
+.P
+.B http://www.php.net/credits.php
+.PD 1
+.P
+And last but not least PHP was developed with the help of a huge amount of
+contributors all around the world.
+.SH VERSION INFORMATION
+This manpage describes \fBphp\fP, version @PHP_VERSION@, \fBfpm\fP, version @fpm_vers...@.
+.SH COPYRIGHT
+Copyright \(co 1997\-2009 The PHP Group
+.PD 0
+.P
+Copyright (c) 2007-2009, Andrei Nigmatulin
+.PD 1
+.LP
+This source file is subject to version 3.01 of the PHP license,
+that is bundled with this package in the file LICENSE, and is
+available through the world-wide-web at the following url:
+.PD 0
+.P
+.B http://www.php.net/license/3_01.txt
+.PD 1
+.P
+If you did not receive a copy of the PHP license and are unable to
+obtain it through the world-wide-web, please send a note to
+.B [email protected]
+so we can mail you a copy immediately.
Added: php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.conf.in
===================================================================
--- php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.conf.in (rev 0)
+++ php/php-src/branches/PHP_5_3_FPM/sapi/fpm/php-fpm.conf.in 2009-12-14 11:57:21 UTC (rev 292129)
@@ -0,0 +1,159 @@
+<?xml version="1.0" ?>
+<configuration>
+
+ All relative paths in this config are relative to php's install prefix
+
+ <section name="global_options">
+
+ Pid file
+ <value name="pid_file">@php_fpm_pid_path@</value>
+
+ Error log file
+ <value name="error_log">@php_fpm_log_path@</value>
+
+ Log level
+ <value name="log_level">notice</value>
+
+ When this amount of php processes exited with SIGSEGV or SIGBUS ...
+ <value name="emergency_restart_threshold">10</value>
+
+ ... in a less than this interval of time, a graceful restart will be initiated.
+ Useful to work around accidental curruptions in accelerator's shared memory.
+ <value name="emergency_restart_interval">1m</value>
+
+ Time limit on waiting child's reaction on signals from master
+ <value name="process_control_timeout">5s</value>
+
+ Set to 'no' to debug fpm
+ <value name="daemonize">yes</value>
+
+ </section>
+
+ <workers>
+
+ <section name="pool">
+
+ Name of pool. Used in logs and stats.
+ <value name="name">default</value>
+
+ Address to accept fastcgi requests on.
+ Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket'
+ <value name="listen_address">127.0.0.1:9000</value>
+
+ <value name="listen_options">
+
+ Set listen(2) backlog
+ <value name="backlog">-1</value>
+
+ Set permissions for unix socket, if one used.
+ In Linux read/write permissions must be set in order to allow connections from web server.
+ Many BSD-derrived systems allow connections regardless of permissions.
+ <value name="owner">@php_fpm_user@</value>
+ <value name="group">@php_fpm_group@</value>
+ <value name="mode">0666</value>
+ </value>
+
+ Additional php.ini defines, specific to this pool of workers.
+ These settings overwrite the values previously defined in the php.ini.
+ <value name="php_defines">
+ <!-- <value name="sendmail_path">/usr/sbin/sendmail -t -i</value> -->
+ <!-- <value name="display_errors">0</value> -->
+ <!-- <value name="error_log">/var/log/php-error.log</value> -->
+ <!-- <value name="log_errors">true</value> -->
+ </value>
+
+ Unix user of processes
+ <value name="user">@php_fpm_user@</value>
+
+ Unix group of processes
+ <value name="group">@php_fpm_group@</value>
+
+ Process manager settings
+ <value name="pm">
+
+ Sets style of controling worker process count.
+ Valid values are 'static' and 'apache-like'
+ <value name="style">static</value>
+
+ Sets the limit on the number of simultaneous requests that will be served.
+ Equivalent to Apache MaxClients directive.
+ Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi
+ Used with any pm_style.
+ <value name="max_children">5</value>
+
+ Settings group for 'apache-like' pm style
+ <value name="apache_like">
+
+ Sets the number of server processes created on startup.
+ Used only when 'apache-like' pm_style is selected
+ <value name="StartServers">20</value>
+
+ Sets the desired minimum number of idle server processes.
+ Used only when 'apache-like' pm_style is selected
+ <value name="MinSpareServers">5</value>
+
+ Sets the desired maximum number of idle server processes.
+ Used only when 'apache-like' pm_style is selected
+ <value name="MaxSpareServers">35</value>
+
+ </value>
+
+ </value>
+
+ The timeout (in seconds) for serving a single request after which the worker process will be terminated
+ Should be used when 'max_execution_time' ini option does not stop script execution for some reason
+ '0s' means 'off'
+ <value name="request_terminate_timeout">0s</value>
+
+ The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file
+ '0s' means 'off'
+ <value name="request_slowlog_timeout">0s</value>
+
+ The log file for slow requests
+ <value name="slowlog">@[email protected]</value>
+
+ Set open file desc rlimit
+ <value name="rlimit_files">1024</value>
+
+ Set max core size rlimit
+ <value name="rlimit_core">0</value>
+
+ Chroot to this directory at the start, absolute path
+ <value name="chroot"></value>
+
+ Chdir to this directory at the start, absolute path
+ <value name="chdir"></value>
+
+ Redirect workers' stdout and stderr into main error log.
+ If not set, they will be redirected to /dev/null, according to FastCGI specs
+ <value name="catch_workers_output">yes</value>
+
+ How much requests each process should execute before respawn.
+ Useful to work around memory leaks in 3rd party libraries.
+ For endless request processing please specify 0
+ Equivalent to PHP_FCGI_MAX_REQUESTS
+ <value name="max_requests">500</value>
+
+ Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect.
+ Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+)
+ Makes sense only with AF_INET listening socket.
+ <value name="allowed_clients">127.0.0.1</value>
+
+ Pass environment variables like LD_LIBRARY_PATH
+ All $VARIABLEs are taken from current environment
+ <value name="environment">
+ <value name="HOSTNAME">$HOSTNAME</value>
+ <value name="PATH">/usr/local/bin:/usr/bin:/bin</value>
+ <value name="TMP">/tmp</value>
+ <value name="TMPDIR">/tmp</value>
+ <value name="TEMP">/tmp</value>
+ <value name="OSTYPE">$OSTYPE</value>
+ <value name="MACHTYPE">$MACHTYPE</value>
+ <value name="MALLOC_CHECK_">2</value>
+ </value>
+
+ </section>
+
+ </workers>
+
+</configuration>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php