【问题标题】:Failed to start Apache Web Server无法启动 Apache Web 服务器
【发布时间】:2014-11-19 09:04:13
【问题描述】:

我正在尝试通过 Wordpress WikiApache and php-fm/mod_proxy_fcgi 在 Arch Linux 上安装 Wordpress。

我通过 pacman 将 Wordpress 安装到“/usr/share/webapps/wordpress/”

当我尝试运行“systemctl start httpd”时出现错误。运行“systemctl status httpd.service -l”输出:

httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: failed (Result: exit-code) since Wed 2014-11-19 03:48:11 EST; 26s ago
Process: 12633 ExecStop=/usr/bin/apachectl graceful-stop (code=exited, status=1/FAILURE)
Process: 13162 ExecStart=/usr/bin/apachectl start (code=exited, status=1/FAILURE)
Main PID: 12463 (code=exited, status=0/SUCCESS)

systemd[1]: Starting Apache Web Server...
apachectl[13162]: AH00526: Syntax error on line 6 of /etc/httpd/conf/extra/httpd-wordpress.conf:
apachectl[13162]: Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
systemd[1]: httpd.service: control process exited, code=exited status=1
systemd[1]: Failed to start Apache Web Server.
systemd[1]: Unit httpd.service entered failed state.
systemd[1]: httpd.service failed.`

“/etc/httpd/conf/extra/httpd-wordpress.conf”包含:

Alias /testing "/usr/share/webapps/wordpress"
<Directory "/usr/share/webapps/wordpress">
        AllowOverride All
        Options FollowSymlinks
        Require all granted
        php_admin_value open_basedir "/srv/:/tmp/:/usr/share/webapps/:/etc/webapps:$"
</Directory>

任何建议将不胜感激。

【问题讨论】:

  • 你安装 PHP 了吗?文档说明: 注意:您需要将 Apache 配置为与 PHP 一起运行。检查 LAMP#PHP 页面以获取说明。 检查以下链接:wiki.archlinux.org/index.php/LAMP#PHP
  • 是的,我有 php 5.6.3-1、php-apache 5.6.3-1、php-fpm 5.6.3-1、php-mcrypt 5.6.3-1 和 phpmyadmin 4.2。 11-1 安装。这似乎只是 Apache 不了解如何运行 httpd-wordpress.conf 中定义的 php_admin_value 命令的问题。我也按照phpmyadmin 的指示配置了文件,但没有变化。
  • 如果我注释掉:Include conf/extra/httpd-wordpress.conf from /etc/httpd/conf/httpd.conf 那么我可以成功启动httpd。

标签: linux wordpress apache archlinux


【解决方案1】:

当使用带有 fastCGI 代理或 PHP-FPM 的 php 时,PHP 运行时不再嵌入到 apache 运行时进程中。这将提高 Apache 网络服务器和 PHP 的性能,因为进程彼此分开存储在内存中,即使在请求是服务器之后也是如此。

但这确实意味着 php 管理值不能再存储在 apache 配置中,就像在 apache 本身中运行 php 时那样。

您可以通过添加来添加服务器范围的 open_basedir 限制

open_basedir = "<insert path here>" 

到您的全局 php.ini 文件,通常存储在 /etc/php5/&lt;runtime&gt;/,您的运行时将是 fpm、fcgid 或类似的东西。

另外,如果您在同一台服务器上有多个网站,可以使用您网站根目录中的.user.ini 文件来设置PHP 值。在.user.ini 文件中设置的值将在允许时覆盖来自php.ini 的任何PHP 设置(请参阅PHP Manual

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-06
    • 2015-07-03
    • 2013-05-08
    • 1970-01-01
    • 2016-04-19
    • 2016-09-23
    • 2018-06-18
    • 1970-01-01
    相关资源
    最近更新 更多