For the linux user, I want to reload or restart my PHP-fpm service. How do I restart PHP-fpm? How do you restart php7.0-fpm on Ubuntu Linux 16.04 LTS server?
PHP-FPM is nothing but a straightforward and robust FastCGI Process Manager for PHP. You can use it with Apache, Nginx, and other web servers. It includes many advanced features. Let us see how to stop or restart or reload PHP-FPM after you update php.ini file.
How do I edit php.ini or www.conf file?
To edit php.ini type:
$ sudo vi /etc/php5/php.ini
OR
$ sudo vi /etc/php/7.0/fpm/php.ini
To edit php-fpm config file:
$ sudo vi /etc/php/7.0/fpm/php-fpm.conf $ sudo vi /etc/php/7.0/fpm/pool.d/www.conf
Once edited, save and close the file. Now you need to run command as per your Linux/Unix distro version after editing the file.
Start php-fpm on CentOS/RHEL 7
$ sudo systemctl start php-fpm
Stop php-fpm CentOS/RHEL 7
$ sudo systemctl stop php-fpm
Reload php-fpm CentOS/RHEL 7
$ sudo systemctl reload php-fpm
Restart php-fpm CentOS/RHEL 7
$ sudo systemctl restart php-fpm
Start/stop/restart/reload php-fpm on CentOS/RHEL 6.x or older
Type the following command:
$ sudo service php-fpm start # For start it $ sudo service php-fpm stop # For stop it $ sudo service php-fpm restart # For restart it $ sudo service php-fpm reload # For reload it
How to start/stop/restart/reload 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 # For restart it $ sudo service php5-fpm reload # For reload it
OR if you are using systemd based distro such as Ubuntu Linux 16.04+ LTS or Debian Linux 8.x+:
$ sudo systemctl start php7.0-fpm.service $ sudo systemctl stop php5-fpm.service $ sudo systemctl restart php5-fpm.service # For restart it $ sudo systemctl reload php5-fpm.service # For reload it
How to start/stop/restart/reload php7.0-fpm (php version 7.x) on Ubuntu/Debian Linux
$ sudo service php7.0-fpmstart $ sudo service php7.0-fpm stop $ sudo service php7.0-fpm restart # For restart it $ sudo service php7.0-fpm reload # For reload it
OR if you are using systemd based distro such as Ubuntu Linux 16.04+ LTS or Debian Linux 8.x+:
$ sudo systemctl start php7.0-fpm.service $ sudo systemctl stop php7.0-fpm.service $ sudo systemctl restart php7.0-fpm.service # For restart it $ sudo systemctl reload php7.0-fpm.service # For reload it
How do you restart/reload php-fpm on FreeBSD unix?
The syntax is
# /usr/local/etc/rc.d/php-fpm start # /usr/local/etc/rc.d/php-fpm stop # /usr/local/etc/rc.d/php-fpm reload # For reload it # /usr/local/etc/rc.d/php-fpm restart # For restart it
OR use the service command:
# service php-fpm start # service php-fpm stop # service php-fpm restart # service php-fpm reload