首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >php5-fpm出错

php5-fpm出错
EN

Stack Overflow用户
提问于 2016-05-08 23:00:44
回答 1查看 189关注 0票数 2

我刚安装了nginx和php-fpm,当我尝试查看我的一个站点时遇到了403错误。当我检查nginx错误日志时,我看到了一些类似权限被拒绝的东西,但我也注意到了这一点:

代码语言:javascript
复制
/var/run/php5-fpm.sock failed (2: no such file or directory)

但是我安装了php-fpm,为什么要加载php5-fpm呢?我被难住了,有什么好主意吗?

谢谢。

编辑: default.conf中的服务器块

代码语言:javascript
复制
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;
#}

}

EN

回答 1

Stack Overflow用户

发布于 2016-05-08 23:51:54

默认情况下,大多数发行版将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/

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37101218

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档