nginx下无法打开php,报错[error] 5040#0: 1 connect failed 111: Connection ref

php中文网
发布: 2016-07-29 08:33:16
原创
1719人浏览过

以下引自stackouverflow-----------------

http://stackoverflow.com/questions/15852884/nginx-connect-failed-error

报错信息如下:


2013/04/06 17:52:19 [error] 5040#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080"
解决办法:

I resolved it, it was a configuration file issue, I added:

location ~ .php$ {

try_files $uri =404; 

立即学习PHP免费学习笔记(深入)”;

 fastcgi_split_path_info ^(.+\.php)(/.+)$; 

法语写作助手
法语写作助手

法语助手旗下的AI智能写作平台,支持语法、拼写自动纠错,一键改写、润色你的法语作文。

法语写作助手 31
查看详情 法语写作助手

 fastcgi_pass unix:/var/run/php5-fpm.sock; 

 fastcgi_index index.php; 

 include fastcgi_params; 

 }

原因:

There are some situations when fastcgi_pass 127.0.0.1:9000; is present in server block and is responsible for this error, in such cases you need change it to fastcgi_pass unix:/var/run/php5-fpm.sock;. –  Kamil Zieliński Dec 8 '13 at 10:34

This is because php5-fpm now ships with the Unix socket listen = /var/run/php5-fpm.sockenabled in /etc/php5/fpm/pool.d/www.conf instead of the TCP socket listen = 127.0.0.1:9000. This is typically a little faster. (For google search purposes) ubuntu 14.04 nginx php5-fpm 502 Bad Gateway. I have a feeling a lot of people will be needing this in the near future. There are so many tutorials with the old socket in place. –  DutGRIFF May 9 at 6:09

以上就介绍了 nginx下无法打开php,报错[error] 5040#0: 1 connect failed 111: Connection ref ,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
php
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号