Apache2重啟/啟動錯誤

Apache2重啟/啟動錯誤

我正在嘗試重新啟動 Apache2,但每當我運行該命令時,都會發生這種情況:

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

現在,當我輸入“systemctl status apache2.service”時,它會列印以下內容:

● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Mon 2016-09-26 14:40:35 CEST; 1min 33s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2183 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 2490 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Sep 26 14:40:35 Asterisk apache2[2490]:  * The apache2 configtest failed.
Sep 26 14:40:35 Asterisk apache2[2490]: Output of config test was:
Sep 26 14:40:35 Asterisk apache2[2490]: [Mon Sep 26 14:40:35.250008 2016] [:crit] [pid 2501:tid 140245312874368] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe.  You need to recompile PHP.
Sep 26 14:40:35 Asterisk apache2[2490]: AH00013: Pre-configuration failed
Sep 26 14:40:35 Asterisk apache2[2490]: Action 'configtest' failed.
Sep 26 14:40:35 Asterisk apache2[2490]: The Apache error log may have more information.
Sep 26 14:40:35 Asterisk systemd[1]: apache2.service: Control process exited, code=exited status=1
Sep 26 14:40:35 Asterisk systemd[1]: Failed to start LSB: Apache2 web server.
Sep 26 14:40:35 Asterisk systemd[1]: apache2.service: Unit entered failed state.
Sep 26 14:40:35 Asterisk systemd[1]: apache2.service: Failed with result 'exit-code'.

我的錯誤日誌(我認為這是我的錯誤日誌) http://hastebin.com/axalecoves.rb

我正在使用運行 16.04.1 的 Ubuntu 伺服器。如果你們有人知道我做錯了什麼,請幫助我。每當我運行sudo a2enmod php7.0命令時就會發生這種情況。當我這樣做時,a2dismod php7.0我可以再次開始它就好了...正如我所說,如果有人知道這件事,請幫助我:)

答案1

正如所說維基百科:

您需要替換mpm_event_modulempm_prefork_module.
開啟文件/etc/httpd/conf/httpd.conf並進行如下編輯:

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

然後重新啟動 Apache 服務。

相關內容