Different ways to Restart PHP-FPM
Knowledgebase Articles and news
Different ways to Restart PHP-FPM
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
- Advanced process management with graceful stop/start.
- Ability to start workers with different uid/gid/chroot/environment, listening on different ports and using different php.ini (replaces safe_mode).
- Stdout and stderr logging.
- Emergency restart in case of accidental opcode cache destruction.
- Accelerated upload support.
- “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.
- Fastcgi_finish_request() – special function to finish request and flush all data while continuing to do something time-consuming (video converting, stats processing etc.).
- Dynamic/static child spawning.
- Basic SAPI status info (similar to Apache mod_status).
- 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.
- We can restart the PHP-FPM from WHM
- Restart the PHP_FPM in command line from the server backend (SSH to the server as a root user)
Restart PHP-FPM from WHM
- Login to your WHM interface.
- Click on the option ‘Restart Services’ .
- Navigate to the option ‘PHP-FPM service for Apache’.
- 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
- SSH into your server as root user.
- Use the following command to restart the PHP-FPM service.
$ /scripts/restartsrv_apache_php_fpm
Articles
7 Articles- Different ways to Restart PHP-FPM
- How To Count Inode Usage In Linux?
- How to install and use Fail2Ban for Security on Ubuntu
- How to install Zabbix Monitoring on Ubuntu 20.04 Server
- How to monitor resource usage on Linux using NMON
- Removing frozen email from EXIM (Frozen emails)
- What are apt, yum, and pacman in Linux? Package Management in Linux