我在最后一天左右一直在谷歌搜索并尝试了几种解决方案。我不知道可能导致此错误的原因。以下可能很长,我道歉 - 我试图预测一些常见的反应,试图帮助诊断问题:)
2014/05/11 17:26:00 [crit] 29833#0: *31 connect() to unix:/var/run/php/default.sock failed (13: Permission denied)
-
server {
server_name .lone0001.ca;
listen 80;
root /home/lone0001/public_html;
error_log /home/lone0001/.nginx/logs/error.log;
access_log /home/lone0001/.nginx/logs/access.log;
include /etc/nginx/includes/global/robots.conf;
include /etc/nginx/includes/global/wordpress.conf;
include /etc/nginx/includes/lone0001_php.conf;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/includes/global/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php/lone0001.sock;
}
" lone0001.conf":
[lone0001]
user = lone0001
group = lone0001
listen = /var/run/php/lone0001.sock
listen.owner = lone0001
listen.group = lone0001
listen.mode = 0666
" www.conf":
[www]
user = www-data
group = www-data
listen = /var/run/php/default.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0666
superuser@myserver:/etc/php5/fpm/pool.d# ls -l /var/run/php/
total 0
srwxrwxr-- 1 www-data www-data 0 May 11 17:21 default.sock
srwxrwxr-- 1 lone0001 lone0001 0 May 11 17:21 lone0001.sock
我已经尝试chmod -Rf 0666 /var/run/php
并且我已经尝试将PHP套接字移动到/tmp
(没有成功)。我也尝试将我的vhost切换到我的"默认" PHP套接字无济于事。
答案 0 :(得分:1)
我打赌这个问题出现在你服务器上的最后一次更新中。
我尝试了您尝试的所有内容,解决方法是将user www-data;
放入/etc/nginx/nginx.conf
文件中。
user www-data;
events {
.....
.....
}
http {
.....
.....
}
然后重启你的机器并希望解决你的问题。