【发布时间】:2021-03-14 07:12:36
【问题描述】:
我已将 macOS 版本升级到 11 Big Sur,无法使用 brew 的 apache 而不是内置版本。
我做了什么:
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew intall httpd
当我尝试启动已安装的 httpd 时,它说 apache 已启动
==> Successfully started httpd (label: homebrew.mxcl.httpd)
但是当我运行 brew services 命令时,我看到 httpd 没有启动(并且 http://localhost:8080 不工作)。
sergeylyskov@MacBook-Pro-Sergey ~ % brew services
Name Status User Plist
httpd error sergeylyskov /Users/sergeylyskov/Library/LaunchAgents/homebrew.mxcl.httpd.plist
php@7.3 stopped
php@7.4 stopped
postgresql@12 stopped
附:我想使用 brew 的版本,因为 apache 中的构建似乎不适用于 php 模块(它在phpinfo() 中不显示 xdebug 和 imagick 扩展)
有什么建议吗?
【问题讨论】:
-
我也有同样的问题。运气好能解决吗?
-
@WawaLoo 很遗憾没有进展,所以我现在使用 docker
-
我发现在 httpd.conf 中设置 ServerName 会导致这个错误。如果您留下 ServerName 注释,它就可以工作。如果您需要虚拟主机并且想要使用 localhost,那么您还需要为 localhost 创建一个虚拟主机。