php - FastCGI PHP7.2 在 Windows 上总是超时 Nginx Bash ubuntu

标签 php bash ubuntu nginx fastcgi

我正在尝试在我的开发机器上安装 PHP7.2 和 Nginx。我的开发机器在 Windows 上的 Bash Ubuntu 16.04 上运行。

在删除以前版本的 PHP 并安装 PHP7.2 之前,我已经安装了工作 Nginx 和 PHP7.0。

错误日志输出:

2017/12/07 03:30:33 [error] 32655#32655: *1 upstream timed out (110: Connection timed out) while reading upstream, client: 127.0.0.1, server: 127.0.0.1, request: "GET /helloworld.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "127.0.0.1"

php7.2-fpm.log:
[07-Dec-2017 03:29:29] NOTICE: Finishing ...
[07-Dec-2017 03:29:29] NOTICE: exiting, bye-bye!
[07-Dec-2017 03:29:30] NOTICE: fpm is running, pid 32683
[07-Dec-2017 03:29:30] NOTICE: ready to handle connections
[07-Dec-2017 03:29:30] NOTICE: systemd monitor interval set to 10000ms

网站可用/默认:
    location ~ \.php$ {
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    }

    location ~ /\.ht {
            deny all;
    }

我试图加载的页面:
<?php echo 'Hello World'; ?>

我已经尝试完全删除所有 PHP7* 和 Nginx 并使用新的配置文件重新安装,但结果相同。

如果我使用 phpinfo() 创建一个页面,它会显示所有信息,但它会继续加载。

我不知道从哪里开始,因为没有出现适当的错误。

最佳答案

解决了,问题是 WSL 不支持 unix:socket 并要求我注释掉:

/etc/nginx/sites-available/default.conf


fastcgi_pass unix:/home/{user}/.valet/valet.sock;

并添加
fastcgi_pass 127.0.0.1:9000;

并在

/etc/php/7.2/fpm/pool.d/www.conf

关于php - FastCGI PHP7.2 在 Windows 上总是超时 Nginx Bash ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47687183/

相关文章:

c# - 需要帮助将 laravel Crypt 转换为 C#

html - 提交后自动返回结果页面

bash - 根据匹配列合并多个文件

c - 我怎样才能在 gcc 中实现 gotoxy()

Java无法获取环境变量(系统属性)

javascript - 将值传递给 HTML &lt;input&gt; 标记

带有 DOMDocument 或 SimpleXML 的 xpath 结果上的 PHP xpath

bash - "tailing"使用 bash 的基于字符串位置的二进制文件?

bash - 使用 tput 时如何在 bash 中使用 printf 格式化列

linux - 如何在 apache 服务器上为 iperf3 配置端口