Search code examples
phplamparchlinux

LAMP on archlinux


There is a nice tutorial on how to set up lamp on archlinux.

After including the following lines in /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

I am getting the folowing error on 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.

If I comment the line LoadModule php5_module modules/libphp5.so, I am getting no more the error but also php its not working. Can anyone help?

It seems that others encountered same issue.

The output of systemctl status httpd.service is:

* 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)

The output of apachectl configtest is:

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


Solution

  • According to the excellent Arch wiki this is a known issue and requires a small configuration change.

    1. Comment the line about the mpm_event_module:

      #LoadModule mpm_event_module modules/mod_mpm_event.so
      
    2. Uncomment the line about mpm_prefork_module:

      LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
      

    Next time, I suggest the Archlinux wiki as it is usually more up to date than blog posts.