简体   繁体   English

无法启动Apache Web服务器

[英]Failed to start Apache Web Server

I'm trying to get Wordpress installed on Arch Linux via the Wordpress Wiki and with Apache and php-fm/mod_proxy_fcgi . 我正在尝试通过Wordpress Wiki以及Apache和php-fm / mod_proxy_fcgi在Arch Linux上安装Wordpress

I installed Wordpress through pacman to "/usr/share/webapps/wordpress/" 我通过pacman将Wordpress安装到“ / usr / share / webapps / wordpress /”

When I try to run "systemctl start httpd" I get an error. 当我尝试运行“ systemctl start httpd”时,出现错误。 Running "systemctl status httpd.service -l" outputs: 运行“ 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" contains: “ /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>

Any suggestions would be greatly appreciated. 任何建议将不胜感激。

When using php with a fastCGI proxy or PHP-FPM, the PHP runtime is not longer embedded in the apache runtime process. 将php与fastCGI代理或PHP-FPM一起使用时,PHP运行时不再嵌入apache运行时进程中。 This will improve performance of your Apache webserver and PHP, since processes are stored in memory separate from each other, even after the request is server. 这将提高Apache Web服务器和PHP的性能,因为即使在请求是服务器之后,进程仍存储在彼此独立的内存中。

However this does mean that php admin values can no longer be stored in the apache configuration, as is possible when running php within apache itself. 但这确实意味着php管理员值不再可以存储在apache配置中,就像在apache本身中运行php时可能的那样。

You can add a server wide open_basedir restriction by adding 您可以通过添加服务器范围的open_basedir限制来添加

open_basedir = "<insert path here>" 

to your global php.ini file, usually stored at /etc/php5/<runtime>/ where your runtime will either be fpm, fcgid, or something along those lines. 到您的全局php.ini文件中,该文件通常存储在/etc/php5/<runtime>/ ,其中您的运行时将是fpm,fcgid或类似的名称。

Additionally, if you have multiple websites on the same server, it is possible to use .user.ini files in the root directory of your website to set PHP values. 此外,如果同一服务器上有多个网站,则可以使用网站根目录中的.user.ini文件来设置PHP值。 Values set in the .user.ini file will override any set PHP from php.ini when allowed (see PHP Manual ) 如果允许,在.user.ini文件中设置的值将覆盖php.ini所有PHP设置(请参阅PHP手册

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

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