小编Num*_*mli的帖子

php -v 和 php-fpm -v 显示不同版本的 php

我整晚都在为此苦苦挣扎,找不到解决它的答案!

我在 mac 上使用自制软件安装 php 和 nginx,我运行了以下显示成功的命令

brew install php
brew install nginx
Run Code Online (Sandbox Code Playgroud)

到目前为止没有问题,我可以启动这两个服务

brew services start nginx
brew services start nginx
Run Code Online (Sandbox Code Playgroud)

当我运行 brew services list 时,我得到以下信息

nginx started me /Users/me/Library/LaunchAgents/homebrew.mxcl.nginx.plist
php   started me /Users/me/Library/LaunchAgents/homebrew.mxcl.php.plist
Run Code Online (Sandbox Code Playgroud)

但是,当尝试运行 Wordpress 站点时,我的 nginx 日志中出现以下错误

[error] 26099#0: *1 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080"
Run Code Online (Sandbox Code Playgroud)

我已经用谷歌搜索了这个问题,它似乎通常是 nginx 将请求传递给 php-fpm 的问题,我已经检查了运行每个服务的用户以确保它们匹配,我已经以我和 root 的身份完成了徒劳无功。当我检查“brew services list”时,它以橙色显示php,我理解这意味着它实际上已经失败了。

我进一步挖掘,似乎如果我运行 'php -v' 我得到 …

php macos homebrew nginx

6
推荐指数
1
解决办法
7941
查看次数

标签 统计

homebrew ×1

macos ×1

nginx ×1

php ×1