【发布时间】:2022-01-02 02:33:08
【问题描述】:
刚刚更新到 Monterey 并让 localhost 连接会出现此错误:
无法访问此站点 localhost 拒绝连接
按照优秀的 brew 指南,我安装了 httpd 并在 MacOS 终端中运行此命令
brew services restart httpd
返回
==>Successfully stopped `httpd` (label: homebrew.mxcl.httpd)
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
但随后连接到:http://localhost:8080/ 会出现上述错误 谢谢
【问题讨论】:
-
你确定8080端口是正确的吗?我宁愿期望 80 作为默认值,并且您没有表明您正在以除默认值之外的任何方式配置 Apache httpd。
-
谢谢@Olaf Kock - 你让我检查了 - 已经尝试了好几次 - 是的,它是 :80 并且它正在工作(令人尴尬) - 谢谢如果你愿意将端口 80 发布为回答我会确认...
-
我也有同样的问题。目前,我正在调查我遇到的一个缺失的自签名权限问题。运行
apachectl configtest得到AH06665: No code signing authority for module at /usr/local/php5/libphp7.so specified in LoadModule directive.吗? -
运行 apachectl configtest 我得到“syntax OK” 尝试“which httpd”并查看它指向的目录(参见下面的部分答案)。我的猜测是代码签名与 Apple 的 Apache 版本有关。下面的链接使用代码签名链接描述了这两个选项。 wpbeaches.com/… 作为代码签名和使用 Apple 内置 Apache 的替代方案,您可能希望同时使用 Homebrew 中的 Apache 和 PHP - 请参阅 getgrav.org/blog/macos-monterey-apache-multiple-php-versions
-
仔细编辑 httpd.conf 完全重新安装 brew 并在关键时刻重新启动计算机有帮助,现在它可以很好地提供 http:localhost - 下一个问题是任何 php 文件都没有呈现所以指向 http:localhost/success.php 的链接在浏览器中返回“”而不是“Success”
标签: macos apache httpd.conf macos-monterey