环境变量的Apache错误(Ubuntu)

时间:2014-02-22 20:10:34

标签: apache environment-variables ubuntu-12.04

我的操作系统是Ubuntu 12.04,我已经分别安装了Apache,Php和Mysql。我从来没有遇到过任何问题,但在Ubuntu更新后,当我尝试访问我的网络服务器上的php文件时,我总是收到“404 Not Found”错误。

当我在我的控制台上写“apache2 -S”时,我得到了这个:

[Sat Feb 22 16:15:16.983766 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined
[Sat Feb 22 16:15:16.983871 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_PID_FILE} is not defined
[Sat Feb 22 16:15:16.983914 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_RUN_USER} is not defined
[Sat Feb 22 16:15:16.983936 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_RUN_GROUP} is not defined
[Sat Feb 22 16:15:16.983966 2014] [core:warn] [pid 4475] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sat Feb 22 16:15:16.987930 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
[Sat Feb 22 16:15:16.988259 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sat Feb 22 16:15:16.988433 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[Sat Feb 22 16:15:16.988456 2014] [core:warn] [pid 4475:tid 139974428579648] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
AH00526: Syntax error on line 75 of /etc/apache2/apache2.conf:
Invalid Mutex directory in argument file:${APACHE_LOCK_DIR} 

有人可以帮我吗?

3 个答案:

答案 0 :(得分:4)

从阅读this bug page开始,我猜测所有这些都是需要在运行apache2之前导出的环境变量。显然,当您将其作为" service apache2 start"等服务运行时,它们会自动从/ ​​etc / apache2 / envvars加载。另一个选择是使用apache2ctl启动它。

答案 1 :(得分:0)

这也是我得到的,当我输入apache2 -S,但一切正常。 如果你看一下apache手册页 - 它只是与一些配置解析数据有关。你的PHP代码有错误吗?看看apache日志文件 - 它们存储在 var / log / apache2 目录下。

答案 2 :(得分:0)

我在Ubuntu Server 14.04上通过Apache 2.4在本地运行Bugzilla时遇到了一个非常类似的问题。运行命令sudo /etc/init.d/apache2 graceful会加载页面,之前Chrome告诉我没有收到任何数据。我希望比我更有知识的人可以解释为什么这有效,但service apache2 startapache2ctl不是。