简体   繁体   English

Mac OS X Sierra升级后,Apache引用了错误的httpd.conf

[英]Apache references wrong httpd.conf after Mac OS X Sierra upgrade

I've recently upgraded to Mac OS X Sierra and it has totally shafted my apache/PHP setup. 我最近升级到了Mac OS X Sierra,它完全使我的apache / PHP设置陷入困境。 Having wasted most of the morning, I've finally found the actual httpd.conf file that is being referenced at /usr/local/etc/apache2/2.2/httpd.conf , whereas the file I need to be using is at /etc/apache2/httpd.conf . 浪费了整个上午的时间,我终于找到了在/usr/local/etc/apache2/2.2/httpd.conf中引用的实际 httpd.conf文件,而我需要使用的文件在/ etc中/apache2/httpd.conf

How can I tell Apache to use the version I was successfully using before the update? 如何告诉Apache使用更新前成功使用的版本?

Not sure about MacOS version, but with any binary of httpd you use the parameter -f, as in: 不确定MacOS的版本,但是使用httpd的任何二进制文件时,请使用-f参数,如下所示:

httpd -k start -f /path/to/conf

In most cases you need to load envvars file in your environment, this file is in bin directory in an official install of httpd and generally adds HTTPD lib directory to LD_LIBRARY_PATH. 在大多数情况下,您需要在环境中加载envvars文件,此文件位于httpd官方安装中的bin目录中,并且通常将HTTPD lib目录添加到LD_LIBRARY_PATH中。 So briefly 简而言之

. /path/to/httpd/bin/envvars
httpd -k start -f /path/to/conf

Or apachectl which is an official script which refers to both to make your life easier. apachectl是官方脚本,指的是两者都使您的生活更轻松。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM