6
votes

I updated today my httpd and php version on Arch for ARM.

The current version is now:
apachectl -V Server version: Apache/2.4.7 (Unix) Server built: Mar 6 2014 17:04:51 Server's Module Magic Number: 20120211:27 Server loaded: APR 1.5.0, APR-UTIL 1.5.3 Compiled using: APR 1.5.0, APR-UTIL 1.5.3 Architecture: 32-bit Server MPM: event threaded: yes (fixed thread count) forked: yes (variable process count)

I need also php for owncloud and other php project, because of that I added the lines:

LoadModule php5_module       modules/libphp5.so
AddHandler php5-script php
Include conf/extra/php5_module.conf

to the file /etc/httpd/conf/httpd.conf.

Before the update this config works fine, after the update apache will not start anymore and it shows always the error:

Mar 07 03:43:59 alarm apachectl[1006]: [Fri Mar 07 03:43:59.408232 2014] [:crit] [pid 1008:tid 3070083072] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
Mar 07 03:43:59 alarm apachectl[1006]: AH00013: Pre-configuration failed
Mar 07 03:43:59 alarm systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 07 03:43:59 alarm systemd[1]: Failed to start Apache Web Server.
Mar 07 03:43:59 alarm systemd[1]: Unit httpd.service entered failed state.

Removing and reinstalling php does not help. How can I fix this problem?

2

2 Answers

12
votes

To switch to prefork MPM on Apache/2.4.7 (like the previous version of Apache), do this in /etc/httpd/conf/httpd.conf:

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so   
#LoadModule mpm_event_module modules/mod_mpm_event.so

and after httpd restart, on my raspberry pi.

apache upgrade in 2.4.7 :

Mar 07 19:33:56 rasperus systemd[1]: Starting Apache Web Server...
Mar 07 19:33:56 rasperus apachectl[23469]: [Fri Mar 07 19:33:56.909344 2014] [:crit] [pid 23471:tid 3069247488] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
Mar 07 19:33:56 rasperus apachectl[23469]: AH00013: Pre-configuration failed
Mar 07 19:33:56 rasperus systemd[1]: httpd.service: control process exited, code=exited status=1
Mar 07 19:33:56 rasperus systemd[1]: Failed to start Apache Web Server.
Mar 07 19:33:56 rasperus systemd[1]: Unit httpd.service entered failed state.

and after modification in httpd.conf :

Mar 07 19:45:11 rasperus systemd[1]: Starting Apache Web Server...
Mar 07 19:45:12 rasperus systemd[1]: PID file /run/httpd/httpd.pid not readable (yet?) after start.
Mar 07 19:45:12 rasperus systemd[1]: Started Apache Web Server.
3
votes

Switch to the prefork MPM (in 2.4, you can change with just LoadModule) or switch your mod_php out to using one of the many fastcgi based options (php-fpm + mod_proxy_fcgi is a popular one).