V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
qwertyzzz
V2EX  ›  PHP

nginx+ PHP 的问题

  •  
  •   qwertyzzz · 2019-01-07 17:34:58 +08:00 · 3328 次点击
    这是一个创建于 1908 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用的 phpstudy,但是 nginx+mysql 启动起来就是不能正常访问,apache 倒是可以,查看 nginx 错误日志是这个错误 upstream prematurely closed connection while reading response header from upstream,

    具体界面是

    An error occurred.
    Sorry, the page you are looking for is currently unavailable.
    Please try again later.
    
    If you are the system administrator of this resource then you should check the error log for details.
    
    Faithfully yours, nginx.
    

    配置文件就先不贴了 不知道有没遇到相同情况的 ,实在没有我在贴一下配置文件 ,主要配置文件是 phpstudy 自己的 按道理应该没问题 不知道是否是哪边参数需要改下

    11 条回复    2019-01-07 22:42:51 +08:00
    liaoguiming
        1
    liaoguiming  
       2019-01-07 17:42:04 +08:00
    php-cgi
    qwertyzzz
        2
    qwertyzzz  
    OP
       2019-01-07 17:46:25 +08:00
    @liaoguiming 咋整
    utfqvfhpyygy
        3
    utfqvfhpyygy  
       2019-01-07 17:50:08 +08:00
    nginx 链接 php 那边有问题了,要不就是 php.这种问题看日志分析
    qwertyzzz
        4
    qwertyzzz  
    OP
       2019-01-07 17:54:16 +08:00
    @utfqvfhpyygy 同事电脑可以的。。妈的 不知道我这边啥问题
    gstqc
        5
    gstqc  
       2019-01-07 18:08:02 +08:00 via Android
    日志
    日志
    日志
    qwertyzzz
        6
    qwertyzzz  
    OP
       2019-01-07 18:12:15 +08:00
    @gstqc 看了个 nginx 日志额 发在上面。。 最开始那句 ,其他还需要看哪边日志呀
    qwertyzzz
        7
    qwertyzzz  
    OP
       2019-01-07 18:31:10 +08:00
    解决了。。。有个 TransHost.exe 的破东西占着 9000 端口。。强制删除后好了
    EvilCult
        8
    EvilCult  
       2019-01-07 18:46:36 +08:00 via iPhone
    /var/log/nginx/error.log

    如果是 Linux 系统的话默认在这
    你那个不叫日志, [手动捂脸]
    tomczhen
        9
    tomczhen  
       2019-01-07 18:51:13 +08:00
    看到 nginx 不可以,apache 可以就能大概猜到了。

    nginx+php-fpm,apache 是内置 php mod,由于页面能现实,所以排除 nginx 本身问题,那么应该是 php-fpm 出了问题。

    话说开发环境下,php artisan serve / php -S localhost:8000 足够。生成环境 windows 上使用 iis+php cgi 也强得多,干嘛要用 phpstudy。。。
    qwertyzzz
        10
    qwertyzzz  
    OP
       2019-01-07 22:42:03 +08:00
    @EvilCult 贴的长的是界面啊 日志里的内容我复制出来了 就第一句
    qwertyzzz
        11
    qwertyzzz  
    OP
       2019-01-07 22:42:51 +08:00
    @tomczhen 小白呀 phpstudy 还是挺方便的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2894 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:53 · PVG 21:53 · LAX 06:53 · JFK 09:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.