[英]Unable to restart Apache on Mac after upgrading php 7.1 to 7.2 with homebrew
After I upgraded php 7.1 to 7.2 I can no longer restart Apache.将 php 7.1 升级到 7.2 后,我无法再重新启动 Apache。 I tried to upgrade it with homebrew following the instructions on the web and I think I did something wrong.
我尝试按照网络上的说明使用自制软件升级它,但我认为我做错了什么。
php -v
PHP 7.2.15 (cli) (built: Feb 26 2019 10:43:45) ( NTS )
shows that i have it.表明我拥有它。
When I try to restart Apache it throws the errors shown below:当我尝试重新启动 Apache 时,它会引发如下所示的错误:
sudo apachectl restart
AH00112: Warning: DocumentRoot [/usr/local/opt/httpd/docs/dummy-host.example.com] does not exist
AH00112:警告:DocumentRoot [/usr/local/opt/httpd/docs/dummy-host.example.com] 不存在
AH00112: Warning: DocumentRoot [/usr/local/opt/httpd/docs/dummy-host2.example.com] does not exist
AH00112:警告:DocumentRoot [/usr/local/opt/httpd/docs/dummy-host2.example.com] 不存在
AH00526: Syntax error on line 144 of /usr/local/etc/httpd/extra/httpd-ssl.conf:
AH00526:/usr/local/etc/httpd/extra/httpd-ssl.conf 第 144 行的语法错误:
SSLCertificateFile: file '/usr/local/etc/httpd/server.crt' does not exist or is empty
SSLCertificateFile: 文件“/usr/local/etc/httpd/server.crt”不存在或为空
It looks like something happened with your Apache config, whether it has been reset, or Apache is looking elsewhere.您的 Apache 配置似乎发生了一些问题,无论是已重置,还是 Apache 正在寻找其他地方。
You can try apachectl -V
to see where they are being loaded from.您可以尝试
apachectl -V
来查看它们是从哪里加载的。
Additionally, I'm not a homebrew user, but it looks as if homebrew installed Apache should be evoked as httpd
.此外,我不是自制软件用户,但看起来安装了自制软件的 Apache 应该被称为
httpd
。
This may help as an additional resource:这可能有助于作为附加资源:
https://joostvanveen.com/a-28/install-and-configure-apache-2-on-mojave-with-homebrew https://joostvanveen.com/a-28/install-and-configure-apache-2-on-mojave-with-homebrew
I had a similar problem with virtual hosts after a recent upgrade;最近升级后,我在虚拟主机上遇到了类似的问题; I've temporarily fixed it by commenting out these two lines in httpd.conf:
我通过在 httpd.conf 中注释掉这两行来临时修复它:
LoadModule vhost_alias_module lib/httpd/modules/mod_vhost_alias.so
Include /usr/local/etc/httpd/extra/httpd-vhosts.conf
That got things working for me, as I can live without vhosts and needed a quick fix.这对我有用,因为我可以在没有虚拟主机的情况下生活并且需要快速修复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.