各个平台上如何重启php7-fpm和php5-fpm
PHP-FPM是一款简单好用的PHP FastCGI进程管理工具。
它可以和Apache、Nginx或其他服务器一起构建完整的PHP环境。
接下来我们看看在更改了php.ini 文件后,如何stop、restart或者reload PHP-FPM,以使修改生效。
修改php.ini文件:
1 2
| $ php --ini $ sudo vi /etc/php.ini
|
修改php-fpm.conf文件:
1
| $ sudo vi /etc/php-fpm/www.conf
|
编辑之后保存。
CentOS/RHEL 7
1 2 3 4
| $ sudo systemctl start php-fpm $ sudo systemctl stop php-fpm $ sudo systemctl reload php-fpm $ sudo systemctl restart php-fpm
|
CentOS/RHEL 6.x等旧版本
1 2 3 4
| $ sudo service php-fpm start $ sudo service php-fpm stop $ sudo service php-fpm restart $ sudo service php-fpm reload
|
Ubuntu/Debian
1 2 3 4
| $ sudo service php5-fpm start $ sudo service php5-fpm stop $ sudo service php5-fpm restart $ sudo service php5-fpm reload
|
如果系统使用systemd,比如Ubuntu Linux 16.04+ LTS或者Debian Linux 8.x+,可以这样:
1 2 3 4
| $ sudo systemctl start php5-fpm.service $ sudo systemctl stop php5-fpm.service $ sudo systemctl restart php5-fpm.service $ sudo systemctl reload php5-fpm.service
|
Ubuntu/Debian操作php7.0-fpm
1 2 3 4
| $ sudo service php7.0-fpm start $ sudo service php7.0-fpm stop $ sudo service php7.0-fpm restart $ sudo service php7.0-fpm reload
|
如果系统使用systemd,比如Ubuntu Linux 16.04+ LTS或者Debian Linux 8.x+,可以这样:
1 2 3 4
| $ sudo systemctl start php7.0-fpm.service $ sudo systemctl stop php7.0-fpm.service $ sudo systemctl restart php7.0-fpm.service $ sudo systemctl reload php7.0-fpm.service
|
Alpine Linux
1 2 3
| # /etc/init.d/php-fpm start # /etc/init.d/php-fpm stop # /etc/init.d/php-fpm restart
|
FreeBSD Unix
1 2 3 4
| # /usr/local/etc/rc.d/php-fpm start # /usr/local/etc/rc.d/php-fpm stop # /usr/local/etc/rc.d/php-fpm reload # /usr/local/etc/rc.d/php-fpm restart
|
或者用service命令:
1 2 3 4
| # service php-fpm start # service php-fpm stop # service php-fpm restart # service php-fpm reload
|
How to reload/restart php7.0-fpm / php5.0-fpm service