温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

php-fpm重启失败如何解决

发布时间:2023-01-31 10:13:51 来源:亿速云 阅读:162 作者:iii 栏目:编程语言

这篇“php-fpm重启失败如何解决”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“php-fpm重启失败如何解决”文章吧。

php-fpm重启失败的解决办法:1、查看一下对应的nginx的配置文件为“root@example:/# vim /etc/nginx/sites-enabled/example.conf”;2、通过“service php7.0-fpm restart”命令重启即可。

在 Ubuntu 服务器上重启 php-fpm失败

在 Ubuntu 服务器上修改过 PHP 配置文件后,想重启 php-fpm ,结果出现了这样的问题:

root@example:/# service php-fpm restart
php-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.conf
1 server {
2         listen 80;
3         server_name abc.example.com;
4         root /mnt/www/example;
5         index index.php index.html;
6
7         location ~ \.php$ {
8                 fastcgi_pass unix:/run/php/php7.0-fpm.sock;
9                 fastcgi_index index.php;
10                 include fastcgi_params;
11         }
12
13         location / {
14                 if (!-e $request_filename) {
15                         rewrite ^(.*)$ /index.php?s=$1 last;
16                         break;
17                 }
18         }
19
20 }

它监听的是 php7.0-fpm , 所以只需重启这个就行:

root@example:/etc/nginx/sites-enabled# service php7.0-fpm restart
php7.0-fpm stop/waiting
php7.0-fpm start/running, process 2807
root@example:/etc/nginx/sites-enabled#

以上就是关于“php-fpm重启失败如何解决”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注亿速云行业资讯频道。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI