現在準備在本地安裝Xampp,以便可以在本地安裝WordPress,調試主題。
但在安裝完後點擊Apache和MySQL開始後,MySQL可以正常運行,但Apache出現以下錯誤:
12:31:24 [Apache] Error: Apache shutdown unexpectedly.
12:31:24 [Apache] This may be due to a blocked port, missing dependencies,
12:31:24 [Apache] improper privileges, a crash, or a shutdown by another method.
12:31:24 [Apache] Press the Logs button to view error logs and check
12:31:24 [Apache] the Windows Event Viewer for more clues
12:31:24 [Apache] If you need more help, copy and post this
12:31:24 [Apache] entire log window on the forums
12:31:24 [Apache] This may be due to a blocked port, missing dependencies,
12:31:24 [Apache] improper privileges, a crash, or a shutdown by another method.
12:31:24 [Apache] Press the Logs button to view error logs and check
12:31:24 [Apache] the Windows Event Viewer for more clues
12:31:24 [Apache] If you need more help, copy and post this
12:31:24 [Apache] entire log window on the forums
在度娘搜索後看到一個方法:XAMPP Error: Apache shutdown unexpectedly. 解決思路
其中說到
“我建議首先 運行在cmd中運行 (安裝目錄)apache/bin/httpd.exe ,之後就很好確定錯誤的具體原因了,而不是根據下面的那樣猜端口”
我試了以下,運行結果顯示這裏出現問題:syntax error on line 555,下面應該是我之前不小心設置,產生的一段代碼,後面我打開Apache的config文件,在最後一段確實有這個代碼,我將這段代碼刪除後,重新運行,發現可以正常運行了。
以後還是得及時記錄總結,不然事後還是不知道怎麼回事。
查了下,httpd.exe 是Apache的相關程序,Apache是一款http服務器軟件。那麼在本地安裝這個軟件是爲了使在本地運行http服務。