Configure PHP-FPM in PHP 5.3.6 as a system service

Source: Internet
Author: User
Tags fpm

PHP-FPM configured in PHP 5.3.6 to service startup

From the beginning of the source code php5.3.3 began to contain PHP-FPM, do not have to play a special patch, just to unlock the source directly configure,

The compilation parameters about PHP-FPM have a –enable-fpm–with-fpm-user=www–with-fpm-group=www–with-libevent-dir=libevent location.

This php-fpm no longer supports commands such as the/USR/LOCAL/PHP/SBIN/PHP-FPM (start|stop|reload) php-fpm patch, which requires signal control:

The master process can understand the following signals

SIGINT, Sigterm immediately terminated.

Sigquit Smooth Termination

SIGUSR1 Reopen the log file

SIGUSR2 smooth overload of all worker processes and reload configuration and binary modules

Example:

PHP-FPM off:

Kill-sigint ' Cat/usr/local/php/var/run/php-fpm.pid '

PHP-FPM reboot:

KILL-SIGUSR2 ' Cat/usr/local/php/var/run/php-fpm.pid '

Second, the configuration file is no longer used in the XML format, and the INI is changed, but configuration parameters are almost the same as before, and can be referenced in the format configuration of the XML format.

—————-supplemental content in PHP 5.3.6 php-fpm configured to service startup —————-

Cp-f/TOOLS/PHP-5.3.6/SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM

PHP-FPM Startup:

# #vim/usr/local/webserver/php/etc/php-fpm.conf

The Php-fpm.pid directory must be:/usr/local/webserver/php/var/run/php-fpm.pid

chmod 755/etc/init.d/php-fpm

/ETC/INIT.D/PHP-FPM start

/sbin/chkconfig--add php-fpm (Add to boot Service list)

/sbin/chkconfig PHP-FPM on

Start, stop, and reboot of PHP-FPM:

/ETC/INIT.D/PHP-FPM start

/ETC/INIT.D/PHP-FPM stop

/ETC/INIT.D/PHP-FPM Reload

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.