如何修复OSX Monterey 12.5上的HTTPD(Apache)错误256
问题:Homebrew安装的Apache2在OSX Monterey 12.5无法运行
我在运行OSX Monterey的Mac上通过Homebrew安装了Apache2,许久未进行LAMP开发,不确定错误何时出现,但升级到OSX 12.5后,Apache无法正常工作。
运行brew services输出如下:
Name Status User File httpd error 256 root ~/Library/LaunchAgents/homebrew.mxcl.httpd.plist mysql started Nizz0k ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
执行停止、启动和重启命令后终端显示“成功”,但Apache仍无法运行,无法访问本地vhosts,brew services仍显示错误。运行apachectl -e error时,Apache提示错误日志权限问题。
已尝试以下操作:
- 卸载并重新安装HTTPD
- 尝试apr-utilities修复方案
- 确认系统自带Apache已停止
目前核心问题是Homebrew运行Apache的方式存在冲突:早期版本似乎需要使用sudo,但现在执行会出现如下警告:
Warning: Taking root:admin ownership of some httpd paths: /usr/local/Cellar/httpd/2.4.54/bin /usr/local/Cellar/httpd/2.4.54/bin/httpd /usr/local/opt/httpd /usr/local/opt/httpd/bin /usr/local/var/homebrew/linked/httpd This will require manual removal of these paths using `sudo rm` on brew upgrade/reinstall/uninstall. Warning: httpd must be run as non-root to start at user login! /Library/LaunchDaemons/homebrew.mxcl.httpd.plist: service already bootstrapped Bootstrap failed: 37: Operation already in progress Error: Failure while executing; `/bin/launchctl bootstrap system /Library/LaunchDaemons/homebrew.mxcl.httpd.plist` exited with 37.
即使按错误提示删除相关路径,重新安装后Root仍会成为这些路径的所有者。
内容的提问来源于stack exchange,提问作者nizz0k
相关产品推荐
相关产品推荐

