LAMP 在 archlinux 上

LAMP on archlinux

关于如何在 archlinux 上设置lampnice tutorial

/etc/httpd/conf/httpd.conf 中包含以下行后:

# Use for PHP 5.x: LoadModule php5_module modules/libphp5.so AddHandler php5-script php Include conf/extra/php5_module.conf

我在 sudo systemctl restart httpd 上收到以下错误:

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

如果我注释行 LoadModule php5_module modules/libphp5.so,我将不再收到错误,但 php 它也不起作用。 有人可以帮忙吗?

似乎 others 遇到了同样的问题。

systemctl status httpd.service的输出是:

* httpd.service - Apache Web Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled) Active: failed (Result: exit-code) since Sun 2015-12-20 11:12:51 EET; 5h 0min ago Process: 2550 ExecStop=/usr/bin/apachectl graceful-stop (code=exited, status=1/FAILURE) Process: 3049 ExecStart=/usr/bin/apachectl start (code=exited, status=1/FAILURE) Main PID: 2390 (code=exited, status=0/SUCCESS)

apachectl configtest的输出是:

[Mon Dec 21 00:46:28.514204 2015] [:crit] [pid 10566:tid 139771165026176] Apache AH00013: Pre-configuration failed

根据优秀 Arch wiki this is a known issue 并需要一个小的配置更改。

  1. 评论关于 mpm_event_module 的行:

    #LoadModule mpm_event_module modules/mod_mpm_event.so
    
  2. 取消注释关于 mpm_prefork_module:

    的行
    LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
    

下次,我建议使用 Archlinux wiki,因为它通常比博客文章更新。