首页 > 文章资讯 > 站长教程 > 建站知识 > php-fpm开启报错-ERROR: An another FPM instance seems to already listen on /tmp/php-cgi.sock
php-fpm开启报错-ERROR: An another FPM instance seems to already listen on /tmp/php-cgi.sock
时间:2023年11月12日
/来源:网络
/编辑:佚名
在升级了php7.2.0版本之后,重新启动php-fpm过程中遇到一个报错。
An another FPM instance seems to already listen on /tmp/php-cgi.sock
# netstat -ant | grep 9000 //查看启动进程,发现没启动成功
我们去查看一下php-fpm.conf里面的配置:
vim /usr/local/php/etc/php-fpm.conf
[www]
listen = /tmp/php-cgi.sock //注意
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
此时我们需要根据配置文件的listen地址做对应的修改:
vim /usr/local/nginx/conf/nginx.conf
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/tmp/php-cgi.sock; //把127.0.0.1:9000改为此行
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
root html;
index index.php index.html index.htm;
}
修改完平滑重启nginx,然后启动php-fpm,OK。
An another FPM instance seems to already listen on /tmp/php-cgi.sock
# netstat -ant | grep 9000 //查看启动进程,发现没启动成功
我们去查看一下php-fpm.conf里面的配置:
vim /usr/local/php/etc/php-fpm.conf
[www]
listen = /tmp/php-cgi.sock //注意
listen.backlog = -1
listen.allowed_clients = 127.0.0.1
listen.owner = www
listen.group = www
此时我们需要根据配置文件的listen地址做对应的修改:
vim /usr/local/nginx/conf/nginx.conf
location ~ [^/]\.php(/|$) {
fastcgi_pass unix:/tmp/php-cgi.sock; //把127.0.0.1:9000改为此行
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
root html;
index index.php index.html index.htm;
}
修改完平滑重启nginx,然后启动php-fpm,OK。
新闻资讯 更多
- 【建站知识】查询nginx日志状态码大于400的请求并打印整行04-03
- 【建站知识】Python中的logger和handler到底是个什么?04-03
- 【建站知识】python3拉勾网爬虫之(您操作太频繁,请稍后访问)04-03
- 【建站知识】xpath 获取meta里的keywords及description的方法04-03
- 【建站知识】python向上取整以50为界04-03
- 【建站知识】scrapy xpath遇见乱码解决04-03
- 【建站知识】scrapy爬取后中文乱码,解决word转为html 时cp1252编码问题04-03
- 【建站知识】scrapy采集—爬取中文乱码,gb2312转为utf-804-03