Php-fpm process shutdown and restart script details

Source: Internet
Author: User
Today I will introduce to you about php-fpm process close and restart command, PHP-FPM is a PHPFastCGI manager, is only for PHP and PHP5.3.3 has Integrated php-fpm, it is no longer a third-party package... today I will introduce to you about php-fpm process close and restart command, PHP-FPM is a PHP FastCGI manager, is only for PHP and PHP5.3.3 has Integrated php-fpm, it is no longer a third-party package.

Let's first understand what is php-fpm

PHP-FPM is a PHP FastCGI manager that is only used for PHP.

PHP-FPM is actually a PHP source code patch, designed to integrate FastCGI process management into the PHP package, you must patch it to your PHP source code, after compiling and installing PHP can be used.

Now we can download the source code tree in the latest PHP 5.3.2 to directly integrate the branch of the PHP-FPM, it is said that the next version will be integrated into the main branch of PHP, relative to Spawn-FCGI, PHP-FPM in the CPU and memory control are better, and the former is easy to crash, must be monitored with crontab, and PHP-FPM is not this annoyance.

PHP5.3.3 has Integrated php-fpm, is no longer a third-party package, PHP-FPM provides a better PHP process management mode, can effectively control the memory and process, can smoothly load PHP configuration, it has more advantages than spawn-fcgi, so it is officially recorded by PHP. /configure with-enable-fpm parameters to open the PHP-FPM, the use of PHP-FPM to control the PHP-CGI FastCGI process.

The master process can understand the following signals:

INT, TERM terminated immediately

QUIT smooth termination

USR1 re-open the log file

USR2 smoothly reloads all worker processes and reloads configuration and binary modules.

Example:

Php-fpm close: kill-INT 'cat/usr/local/php/var/run/php-fpm.pid 'php-fpm restart: kill-USR2 'cat/usr/local/php/var/run/php-fpm.pid'

View the number of php-fpm processes: ps aux | grep-c php-fpm

Restart php-fmp:

Run: killall php-fpm // phprm.com

Run the command again (usr/local/php is the php installation directory)

/usr/local/php/sbin/php-fpm &

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.