connect() failed (111: Connection refused) while connecting to upstream
2015-02-13 16:45
686 查看
配置好lamp后,在浏览器中运行程序后,出现上面的错误。
转自:http://www.xuejiehome.com/blread-1828.html
I'm experiencing 502 gateway errors when accessing a PHP file in a directory (http://domain.com/dev/index.php), the logs simply says this:
The answer:
It sounds like you haven't started and configured backend for Nginx. Start php-fpm and add the following to nginx.conf, in http context:
大概意思是你没有启动或者配置php-fpm.其中“/usr/local/nginx/html”为网站根目录。
而我刚好是没有启动php-fpm,在终端运行“service php-fpm start”;
ok,正常运行了。
转自:http://www.xuejiehome.com/blread-1828.html
I'm experiencing 502 gateway errors when accessing a PHP file in a directory (http://domain.com/dev/index.php), the logs simply says this:
2011/09/30 23:47:54 [error] 31160#0: *35 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx, server: domain.com, request: \"GET /dev/ HTTP/1.1\", upstream: \"fastcgi://127.0.0.1:9000\", host: \"domain.com\"
The answer:
It sounds like you haven't started and configured backend for Nginx. Start php-fpm and add the following to nginx.conf, in http context:
server { listen 127.0.0.1; server_name localhost; error_log /var/log/nginx/localhost.error_log info; root /usr/local/nginx/html; location ~ \\.php$ { root html;#此处和server下面root保持一致,默认为html fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/$fastcgi_script_name; include fastcgi_params; } }
大概意思是你没有启动或者配置php-fpm.其中“/usr/local/nginx/html”为网站根目录。
而我刚好是没有启动php-fpm,在终端运行“service php-fpm start”;
ok,正常运行了。
相关文章推荐
- 遇到问题----connect() failed (111: Connection refused) while connecting to upstream解决
- 遇到问题----connect() failed (111: Connection refused) while connecting to upstream解决
- 配置nginx.config 报错:connect() failed (111: Connection refused) while connecting to upstream解决
- [nginx] connect() failed (111: Connection refused) while connecting to upstream, client: 101.18.123.107, server: localhost,
- connect() failed (111: Connection refused) while connecting to upstream的解决
- 问题:connect() failed (111: Connection refused) while connecting to upstream
- connect() failed (111: Connection refused) while connecting to upstream
- Nginx报错 connect() failed (111: Connection refused) while connecting to upstream 的解决方法
- nginx 报错 connect() failed (111: Connection refused) while connecting to upstream
- nginx之connect() failed (110: Connection timed out) while connecting to upstream
- rsync: failed to connect to x.x.x.x: Connection refused (111)
- Failed to connect to socket /com/ubuntu/upstart: Connection refused: Errors were encountered while p
- 解决nginx访问问题connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream,
- 解决Nginx的connect() to xxx.xx.xxx.xxx:2345 failed (13: Permission denied) while connecting to upstream
- nginx connect() failed (113: No route to host) while connecting to upstream
- rsync: failed to connect to x.x.x.x: Connection refused (111)
- Failed to connect to remote VM. Connection refused. Connection refused: connect
- Open edXDevstack启动出现:could not connect to localhost:27017: [Errno 111] Connection refused.
- Failed to connect to SDP server on FF:FF:FF:00:00:00: Connection refused问题解决方法
- socket() failed (13: Permission denied) while connecting to upstream