Error with php5-fpm


Error with php5-fpm

我刚刚安装了nginx和php-fpm,当我试图查看我的一个网站时遇到403错误。当我查看nginx错误日志时,我看到了一些事情,比如权限被拒绝,但我也注意到了这一点:

/var/run/php5-fpm.sock failed (2: no such file or directory)

但是我安装了php-fpm,为什么它要加载php5-fpm?我被难住了,有什么想法吗?

谢谢。

EDIT:default.conf 中的服务器块

server {
listen   81 default_server;
server_name  _;
#charset koi8-r;
#access_log  logs/host.access.log  main;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
    root   /usr/share/nginx/html;
    index  index.html index.htm;
}
error_page  404              /404.html;
location = /404.html {
    root   /usr/share/nginx/html;
}
# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ '.php$ {
#    proxy_pass   http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ '.php$ {
#    root           html;
#    fastcgi_pass   127.0.0.1:9000;
#    fastcgi_index  index.php;
#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
#    include        fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /'.ht {
#    deny  all;
#}

}

默认情况下,大多数发行版将php-fpm配置为侦听端口9000上的TCP套接字。

确保您的fpm实际配置为侦听文件套接字

listen = /var/run/php5-fpm.sock

或者将nginx配置为fcgi_pass 127.0.0.1:9000

这是的完整指南

https://support.rackspace.com/how-to/installing-nginx-and-php-fpm-setup-for-php-fpm/