zoukankan      html  css  js  c++  java
  • 关于nginx配置的一个报错connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory)

    针对配置php的情况:

    linux服务器一般提示这个

    connect() to unix:/tmp/php-cgi.sock failed (2: No such file or directory) while connecting to upstream, client: x.x.x.x, server: xxx.xxx.xxx, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:"

    win服务器一般提示

    connect() failed (111: Connection refused) while connecting to upstream, client: x.x.x.x, server: xxx.xxx.xxx, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000"

    这两个提示,一般就是配置文件错误。我们配置nginx支持php时,会有一个

    以前,不是配置成:fastcgi_pass   unix:/tmp/php-cgi.sock; (linux机器)

    就是配置成:fastcgi_pass   127.0.0.1:9000; (win机器)

    结果就报以上错误。此时,这个配置成什么,有系统决定形式,但具体内容,要看php对应的php-fpm的配置文件

    /www/server/php/73/etc/php-fpm.conf (我机器的位置)

    要看这个文件的内容,编辑该文件,找到 listen = /tmp/php-cgi-73.sock 这一行。将等于号后边的内容复制到nginx的配置文件里,替换fastcgi_pass后边的值。

    然后重启nginx即可。

    而此处我同时还配置了jsp的访问。那么,也报了几乎同样的错误。其实,最终发现,是tomcat的配置端口写错了。

    总之,有报错,就一定有配置写错。仔细找找可能错的地方。一般就是路径配置,和参数文件的指定,在一个就是端口。保证这三个地方没问题。一般就不会有太大问题。

  • 相关阅读:
    druid 配置监控界面和开启spring支持
    关于ComboGrid取值为非下拉框数据是,隐藏面板数据清空
    Error:Execution failed for task ‘:app:processDebugManifest’.
    The newly created daemon process has a different context than expected
    在CentOs6.5下安装Python2.7.6和Scrapy
    【转】Ehcache详细解读
    项目代码的缺陷
    hibernateTemplate
    java.text.SimpleDateFormate错误
    关于集合的空指针问题
  • 原文地址:https://www.cnblogs.com/leafinwind/p/11186484.html
Copyright © 2011-2022 走看看