是Linux和Unix系统的新用户。我想重新加载或重新启动我的PHP-fpm服务。
PHP-FPM仅仅是一个简单而强大的PHP FastCGI Process Manager。您可以将其与Apache,Nginx和其他Web服务器一起使用。它包括许多高级功能。让我们看看更新php.ini文件后如何停止或重新启动或重新加载PHP-FPM。
如何编辑php.ini或www.conf文件?
要编辑php.ini,请输入:
$ sudo vi /etc/php5/php.ini
1
$sudovi/etc/php5/php.ini
或
$ sudo vi /etc/php/7.0/fpm/php.ini
1
$sudovi/etc/php/7.0/fpm/php.ini
要编辑php-fpm配置文件:
$ sudo vi /etc/php/7.0/fpm/php-fpm.conf
$ sudo vi /etc/php/7.0/fpm/pool.d/www.conf
1
2
$sudovi/etc/php/7.0/fpm/php-fpm.conf
$sudovi/etc/php/7.0/fpm/pool.d/www.conf
编辑后,保存并关闭文件。然后根据Linux/Unix发行版运行命令来重载/重启php-fpm服务。
在CentOS/RHEL 7上启动php-fpm
$ sudo systemctl start php-fpm
1
$sudosystemctlstartphp-fpm
停止php-fpm CentOS/RHEL 7
$ sudo systemctl stop php-fpm
1
$sudosystemctlstopphp-fpm
重新加载php-fpm CentOS/RHEL 7
$ sudo systemctl reload php-fpm
1
$sudosystemctlreloadphp-fpm
重新启动php-fpm CentOS / RHEL 7
$ sudo systemctl restart php-fpm
1
$sudosystemctlrestartphp-fpm
在CentOS/RHEL 6.x或更早版本上启动/停止/重新启动/重新加载php-fpm
$ sudo service php-fpm start #
$ sudo service php-fpm stop #
$ sudo service php-fpm restart #
$ sudo service php-fpm reload #
1
2
3
4
$sudoservicephp-fpmstart#
$sudoservicephp-fpmstop#
$sudoservicephp-fpmrestart#
$sudoservicephp-fpmreload#
如何在Ubuntu/Debian Linux上启动/停止/重新启动/重新加载php5-fpm(php版本5.x)
$ sudo service php5-fpm start
$ sudo service php5-fpm stop
$ sudo service php5-fpm restart #
$ sudo service php5-fpm reload #
1
2
3
4
$sudoservicephp5-fpmstart
$sudoservicephp5-fpmstop
$sudoservicephp5-fpmrestart#
$sudoservicephp5-fpmreload#
或者,如果您使用的是基于systemd的发行版,例如Ubuntu Linux 16.04+ LTS或Debian Linux 8.x +:
$ sudo systemctl start php7.0-fpm.service
$ sudo systemctl stop php5-fpm.service
$ sudo systemctl restart php5-fpm.service #
$ sudo systemctl reload php5-fpm.service #
1
2
3
4
$sudosystemctlstartphp7.0-fpm.service
$sudosystemctlstopphp5-fpm.service
$sudosystemctlrestartphp5-fpm.service#
$sudosystemctlreloadphp5-fpm.service#
如何在Ubuntu/Debian Linux上启动/停止/重新启动/重新加载php7.0-fpm(php版本7.x)
$ sudo service php7.0-fpmstart
$ sudo service php7.0-fpm stop
$ sudo service php7.0-fpm restart #
$ sudo service php7.0-fpm reload #
1
2
3
4
$sudoservicephp7.0-fpmstart
$sudoservicephp7.0-fpmstop
$sudoservicephp7.0-fpmrestart#
$sudoservicephp7.0-fpmreload#
或者,如果您使用的是基于systemd的发行版,例如Ubuntu Linux 16.04+ LTS或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 #
$ sudo systemctl reload php7.0-fpm.service #
1
2
3
4
$sudosystemctlstartphp7.0-fpm.service
$sudosystemctlstopphp7.0-fpm.service
$sudosystemctlrestartphp7.0-fpm.service#
$sudosystemctlreloadphp7.0-fpm.service#
如何在Alpine Linux上重新启动/重新加载php-fpm?
# /etc/init.d/php-fpm start
# /etc/init.d/php-fpm stop
# /etc/init.d/php-fpm restart #
1
2
3
# /etc/init.d/php-fpm start
# /etc/init.d/php-fpm stop
# /etc/init.d/php-fpm restart #
如何在FreeBSD Unix上重新启动/重新加载php-fpm?
# /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 #
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命令:
# service php-fpm start
# service php-fpm stop
# service php-fpm restart
# service php-fpm reload
1
2
3
4
# service php-fpm start
# service php-fpm stop
# service php-fpm restart
# service php-fpm reload