【问题标题】:Apache error with environment variables (Ubuntu)Apache 环境变量错误(Ubuntu)
【发布时间】:2014-03-24 11:17:17
【问题描述】:

我的操作系统是 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} 

谁能帮帮我?

【问题讨论】:

    标签: apache environment-variables ubuntu-12.04


    【解决方案1】:

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

    【讨论】:

    • 我不知道,谢谢。我的日志说:AH00094:命令行:'/usr/sbin/apache2'...我真的不知道问题出在哪里,自两周前以来我一直在努力解决这个问题。没有php错误。只是404错误。在这次 Ubuntu 更新之前,一切正常。
    • 好吧,我建议您删除所有堆栈并重新安装。这是一个很好的指南howtoforge.com/…
    【解决方案2】:

    通过阅读this bug page,我推测所有这些都是需要在运行apache2之前导出的环境变量。显然,当您将其作为“服务 apache2 启动”之类的服务运行时,它们会自动从 /etc/apache2/envvars 加载。另一种选择是使用 apache2ctl 启动它。

    【讨论】:

      【解决方案3】:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-09-19
        • 1970-01-01
        • 1970-01-01
        • 2016-11-04
        • 1970-01-01
        • 2011-02-25
        相关资源
        最近更新 更多