php-fpm開啟報錯-ERROR: An another FPM instance seems to already listen on /tmp/php-cgi.sock詳解


重新啟動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 (nginx -s reload ),然后啟動php-fpm


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM