如何修复HTTPD(Apache)错误256在OSX蒙特雷12.5

zlhcx6iw  于 2022-11-16  发布在  Apache
关注(0)|答案(1)|浏览(457)

我在运行OSX Monterey的Mac上安装了一个Apache2和Homebrew。我已经有一段时间没有进行LAMP开发了,所以我不确定错误是什么时候开始的,但是我最近将OSX更新到了12.5。当我回到LAMP项目工作时,我的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 .
运行stop、start和restart命令会在终端中产生“success”输出,但Apache不工作。我无法导航到我的本地vhosts,当然,运行brew services仍然显示错误。
在运行apachectl -e error时,Apache会向错误日志抱怨权限问题
我试过:
1.卸载和重新安装HTTPD

  1. apr实用程序修复。
    1.确认Mac安装的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恢复为所有者。

c3frrgcw

c3frrgcw1#

我确实有同样的问题与nginx。手动卸载它,然后重新启动它工作正常。
请尝试:

sudo launchctl bootout system /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
sudo brew services start httpd

相关问题