Common operations for PHP-FPM

Source: Internet
Author: User

After the PHP-FPM is installed, there is no end command that comes with it, which can be done in the following ways:

1. First check the PHP-FPM process number:

PS grep php-fpm

  

You can see that the master process number is 91790 and there are two child processes, so when the parent process ends, the child process ends up with the following command:

Kill 91791

After kill, the PHP-FPM is finished, and then configured, the boot is ready.

2, this method is the recommended method can smooth end and restart the PHP-FPM process, the method is as follows:

First kill the process according to Method 1, and then use vim etc/php-fpm.conf to open the configuration file

Remove the semicolon in front of the PID and generate the PID file by default at run time

  

Then save and exit, using the sbin/php-fpm boot process can be found under/usr/local/php/var/run php-fpm.pid file, the file is stored in method 1 using the command to see the process number

At this point, the process ends and the restart operation is possible.

Terminate process immediately: kill -int 'cat /usr/local/php/var/run/php-fpm.pid '

Smooth termination process: kill -quit 'cat /usr/local/php/var/run/php-fpm.pid '

Smooth restart process: kill -usr2 'cat /usr/local/php/var/run/php-fpm.pid '

Note that the above 3 commands are used to refer to the file, the recommended way in production is to smoothly reload the PHP-FPM all worker processes, configuration, and binary modules using the third command

View PHP-FPM the number of processes can be counted using the-c parameter of the pipe, the command is: ps aux | grep -C php-fpm or PS -ef | grep -C php-fpm

Statistics come out of the hypothesis is 4, then the actual number of processes except grep itself is a total of 3 processes

Common operations for 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.