2014-03-07 64 views
5

我今天更新了Arch for ARM的httpd和php版本。現在httpd不會開始爲php添加行

目前的版本是:
的apachectl -V Server版本:阿帕奇/ 2.4.7(UNIX) Server內置:2014年3月6日17時04分51秒 服務器的模塊幻數:20120211:27 服務器加載時間:APR 1.5.0,APR-UTIL 1.5.3 使用:APR 1.5.0,APR-UTIL編譯1.5.3 架構:32位 服務器MPM:事件 線程:是(固定線程數) 分叉:是(可變過程計數)

我還需要php for owncloud和其他php項目,beca使用我添加的行:

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

到/etc/httpd/conf/httpd.conf文件。

更新前這個配置能正常工作,後更新Apache將不再啓動,它總是顯示錯誤:

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. 

刪除並重新安裝PHP沒有幫助。我該如何解決這個問題?

回答

3

切換到prefork MPM(在2.4中,你可以改變只是LoadModule),或者切換你的mod_php到使用許多基於fastcgi的選項之一(php-fpm + mod_proxy_fcgi是一個流行的選項)。

+1

一個很好的教程,請http://www.binarytides.com/setup- Apache的PHP-FPM-MOD-代理FCGI Ubuntu的/ – brauliobo

11

要切換到prefork的MPM在Apache/2.4.7(像以前版本的Apache),在/etc/httpd/conf/httpd.conf做到這一點:

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

和httpd的重新啓動後,我的覆盆子PI。

阿帕奇升級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. 

,並在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.