Documentation

From PHP-FPM

Jump to: navigation, search

Mailinglists

Please do not hesitate to write an email to groups if you've got any questions.

Howto

PHP-FPM was tested to run on Linux, Mac OS X, Solaris and FreeBSD.

Fix Exploit php.ini cgi.fix_pathinfo=0

Make sure libxml2 (and libxml2-devel) is installed, and libevent version is 1.4.12 or later

Download latest PHP and PHP-FPM

for PHP 5.2.x:

$ wget -c http://us3.php.net/get/php-5.2.17.tar.gz/from/this/mirror
$ tar xvfz php-5.2.17.tar.gz
$ cd php-5.2.17
$ wget -c http://php-fpm.org/downloads/php-5.2.17-fpm-0.5.14.diff.gz
$ gunzip php-5.2.17-fpm-0.5.14.diff.gz
$ patch -p1 < php-5.2.17-fpm-0.5.14.diff
$ ./configure --enable-fastcgi --enable-fpm --with-libevent[=path] ...

autorun php-fpm:

$ ln -s /usr/local/sbin/php-fpm /etc/init.d/php-fpm
$ /usr/sbin/update-rc.d -f php-fpm defaults

for PHP 5.3.x:

$ cd php-5.3.x
$ svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm sapi/fpm
$ ./buildconf --force
$ ./configure --enable-fpm ...your other configure options, etc...
$ make && make install

Edit /etc/php-fpm.conf (or /usr/local/etc/php-fpm.conf under BSD)

Run php-fpm start (probably in your $PATH)

Check logfile /var/log/php-fpm.log for details if needed

Run phpinfo() to check your site is still working

Pid of master process is stored in /var/run/php-fpm.pid

Master process understands signals

SIGINT, SIGTERM immediate termination
SIGQUIT graceful stop
SIGUSR1 re-open log file
SIGUSR2 graceful reload of all workers + reload of fpm conf/binary