在部署項目的時候遇到了 An another FPM instance seems to already listen on /tmp/php-cgi.sock
解決方法:php
netstat -ant | grep 9000 //查看啓動進程,發現沒啓動成功
查看php-fpm.conf裏面的配置:html
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地址作對應的修改:nginx
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就恢復正常了.vim