PHP-FPM is a FastCGI process manager for PHP used with many popular web servers like Apache and Nginx among others. You would want to reload or restart PHP-FPM whenever you change the PHP settings.
The PHP settings can be changed from the appropriate php.ini file or PHP-FPM config file. You can find the appropriate php.ini file by following this guide.
These are the various commands to reload, start, stop, and restart PHP-FPM Service depending on the platform that you have. The examples below are for PHP 7.4. For other versions, you have to change the command to correspond to the appropriate version.
Generally, you can find out the PHP version by running this command:
$ php -v
with similar results:
PHP 8.0.12 (cli) (built: Oct 22 2021 12:34:00) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies
with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans
Find out more details here.
systemd Ubuntu/Debian Linux (Ubuntu 16.04; 18.04; 20.02 LTS or Debian Linux 8.x+)
$ sudo systemctl start php7.4-fpm.service
$ sudo systemctl stop php7.4-fpm.service
$ sudo systemctl restart php7.4-fpm.service
$ sudo systemctl reload php7.4-fpm.service
Or reload, start, stop, and restart PHP-FPM Service for both systemd and non-systemd distros (prior to Ubuntu Linux 16.04 LTS or Debian Linux 8).
$ sudo service php7.4-fpm start
$ sudo service php7.4-fpm stop
$ sudo service php7.4-fpm restart
$ sudo service php7.4-fpm reload
How to Reload, Start, Stop, Restart php5-fpm (php version 5.x) on Ubuntu/Debian Linux.
$ sudo service php5-fpm start
$ sudo service php5-fpm stop
$ sudo service php5-fpm restart
$ sudo service php5-fpm reload
How to Reload, Start, Stop, Restart PHP-FPM on CentOS/RHEL 7.
$ sudo systemctl start php-fpm
$ sudo systemctl stop php-fpm
$ sudo systemctl restart php-fpm
$ sudo systemctl reload php-fpm
How to Reload, Start, Stop, Restart PHP-FPM on CentOS/RHEL 6.x or older.
$ sudo service php-fpm start
$ sudo service php-fpm stop
$ sudo service php-fpm restart
$ sudo service php-fpm reload
Bonus: How to Reload, Start, Stop, Restart PHP-FPM on FreeBSD Unix?
# /usr/local/etc/rc.d/php-fpm start
# /usr/local/etc/rc.d/php-fpm stop
# /usr/local/etc/rc.d/php-fpm restart
# /usr/local/etc/rc.d/php-fpm reload
Or with the service command
# service php-fpm start
# service php-fpm stop
# service php-fpm restart
# service php-fpm reload
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.