【mac.apache】报错 AH00557 AH00558

it2026-06-13  0

AH00557: httpd: apr_sockaddr_info_get() failed for liumoujiadeMacBook-Pro.local AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message

原因是存在两个apache 一个mac自带的,在/usr/sbin/apachectl 另一个是brew install php伴随的,在 /usr/local/Cellar/httpd/2.4.46/bin/apachectl,存在映射/usr/local/bin/apachectl,所以终端输入apachectl使用的是这个。

下图是各自Unix可执行文件打开后的配置

解决方法

How to completely uninstall Homebrew Apache httpd24? 一行命令即可,保存在fix_apache命令中,再次出现可以直接使用

alias fix_apache='sudo apachectl stop; sudo pkill -f /usr/local/Cellar/httpd; sudo pkill -f /usr/sbin/httpd; sudo pkill -f /usr/local/opt/httpd; brew unlink httpd; brew uninstall --ignore-dependencies --force httpd; sudo apachectl start;'

拆分

sudo apachectl stop sudo pkill -f /usr/local/Cellar/httpd sudo pkill -f /usr/sbin/httpd sudo pkill -f /usr/local/opt/httpd brew unlink httpd brew uninstall --ignore-dependencies --force httpd sudo apachectl start
最新回复(0)