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, macosx, solaris and freebsd.

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:

$ bzip2 -cd php-5.2.11.tar.bz2 | tar xf -
$ patch -d php-5.2.11 -p1 <php-fpm-0.6~5.2.patch
$ cd php-5.2.11 
$ ./buildconf --force
$ ./configure --enable-fastcgi --with-fpm --with-libevent[=path] ...

for PHP 5.3.1:

$ tar -xzf php-fpm-0.6~5.3.1.tar.gz
$ php-fpm-0.6-5.3.1/generate-fpm-patch
$ bzip2 -cd php-5.3.1.tar.bz2 | tar xf -
$ patch -d php-5.3.1 -p1 <fpm.patch
$ cd php-5.3.1
$ ./buildconf --force
$ ./configure --with-fpm --with-libevent[=path] ...

Install:

$ make all install

Add to autorun php-fpm:

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

Edit /etc/php-fpm.conf

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
Personal tools