Different ways to Restart PHP-FPM
By Jithin on January 10th, 2019
We all are familiar with PHP-FPM (FastCGI Process Manager). It is an alternative PHP FastCGI implementation with some additional features. It helps to reduce CPU usage by increasing the server’s available RAM in order to cache PHP scripts in the memory. This method is used instead of starting up a separate PHP process for each and every PHP request. It is mainly used for busier sites with any sizes.
Features of PHP-FPM
1) Advanced process management with graceful stop/start.
2) Ability to start workers with different uid/gid/chroot/environment, listening on different ports and using different php.ini (replaces safe_mode).
3) Stdout and stderr logging.
4) Emergency restart in case of accidental opcode cache destruction.
5) Accelerated upload support.
6) “slowlog” – logging scripts (not just their names, but their PHP backtraces too, using ptrace and similar things to read remote process’ execute_data) that are executed unusually slow.
7) Fastcgi_finish_request() – special function to finish request and flush all data while continuing to do something time-consuming (video converting, stats processing etc.).
8) Dynamic/static child spawning.
9) Basic SAPI status info (similar to Apache mod_status).
10) Php.ini-based config file.
In certain cases, we need to restart the PHP-FPM service, we can perform a Php-fpm restart using the following two possible methods.
1) We can restart the PHP-FPM from WHM
2) Restart the PHP_FPM in command line from the server backend (SSH to the server as a root user)
Restart PHP-FPM from WHM
1) Login to your WHM interface.
2) Click on the option ‘Restart Services’.
3) Navigate to the option ‘PHP-FPM service for Apache’.
4) You will navigate to a screen which asks for confirmation to restart PHP-FPM, click on the button ‘Yes’ to restart PHP-FPM.
Restart PHP-FPM via SSH
1) SSH into your server as root user.
2) Use the following command to restart the PHP-FPM service.
If you need any further help, please do reach our support department.