php-fpm重启失败的解决办法:1、查看一下对应的nginx的配置文件为“root@example:/# vim /etc/nginx/sites-enabled/example.conf”;2、通过“service php7.0-fpm restart”命令重启即可。
本教程操作环境:ubuntu 16.04系统、php7.0版、dell g3电脑
php-fpm 重启失败怎么办?
在 ubuntu 服务器上重启 php-fpm失败
在 ubuntu 服务器上修改过 php 配置文件后,想重启 php-fpm ,结果出现了这样的问题:
root@example:/# service php-fpm restartphp-fpm: unrecognized service
查看一下对应服务:
root@example:/# service --status-all | grep -i fpm[ ? ] aliyun-rdate[ ? ] console-setup[ ? ] dns-clean[ ? ] irqbalance[ ? ] killprocs[ ? ] kmod[ ? ] mysql[ ? ] networking[ ? ] ondemand[ + ] php5-fpm[ + ] php7.0-fpm[ ? ] pppd-dns[ ? ] rc.local[ ? ] sendsigs[ ? ] umountfs[ ? ] umountnfs.sh[ ? ] umountroot
原来之前的人给服务器装了两个版本的 php-fpm ,而且都不名字都不叫 php-fpm ,所以我光打个 php-fpm 系统是不认识的。
查看一下对应的 nginx 的配置文件:
root@example:/# vim /etc/nginx/sites-enabled/example.conf1 server {2 listen 80;3 server_name abc.example.com;4 root /mnt/www/example;5 index index.php index.html;67 location ~ \.php$ {8 fastcgi_pass unix:/run/php/php7.0-fpm.sock;9 fastcgi_index index.php;10 include fastcgi_params;11 }1213 location / {14 if (!-e $request_filename) {15 rewrite ^(.*)$ /index.php?s=$1 last;16 break;17 }18 }1920 }
它监听的是 php7.0-fpm , 所以只需重启这个就行:
root@example:/etc/nginx/sites-enabled# service php7.0-fpm restartphp7.0-fpm stop/waitingphp7.0-fpm start/running, process 2807root@example:/etc/nginx/sites-enabled#
推荐学习:《php视频教程》
以上就是php-fpm 重启失败怎么办的详细内容。