在 macOS Sierra 上卸载 laravel/valet 和 Homestead 后,我切换回 Apache(而不是 NGINX),尝试使用 重新启动它sudo apachectl -k restart
,它输出此错误:
httpd not running, trying to start
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
附加信息- 使用 Homebrew 1.3.1 和 OS Sierra 10.12.6。还使用了与此处找到的类似的本地环境: https ://getgrav.org/blog/macos-sierra-apache-multiple-php-versions
免责声明: 我几乎从不使用 NGINX,但我假设它,或者 laravel/valet 设置中涉及的其他东西阻止 Apache 绑定到正确的端口。
如何修复此错误并重新配置 Apache 以再次使用 Homebrew,而不是 NGINX?
没有输出,lsof -i | grep LISTEN | grep ":80"
但有sudo lsof -i :80
以下输出:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 12146 root 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 12148 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 37113 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 37114 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 37115 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)
httpd 38654 _www 4u IPv6 0x3f591ee6220c2a09 0t0 TCP *:http (LISTEN)