1. 程式人生 > >【虛擬機器/伺服器】XAMPP錯誤: Apache shutdown unexpectedly解決辦法

【虛擬機器/伺服器】XAMPP錯誤: Apache shutdown unexpectedly解決辦法

XAMPP安裝好之後啟動,但有些使用者在啟動apache的時候會出現:

11:41:38 [Apache] Status change detected: running
11:41:38 [Apache] Status change detected: stopped
11:41:38 [Apache] Error: Apache shutdown unexpectedly.
11:41:38 [Apache] This may be due to a blocked port, missing dependencies,
11:41:38 [Apache] improper privileges
, a crash, or a shutdown by another method. 11:41:38 [Apache] Press the Logs button to view error logs and check 11:41:38 [Apache] the Windows Event Viewer for more clues 11:41:38 [Apache] If you need more help, copy and post this 11:41:38 [Apache] entire log window on the forums

錯誤原因

XAMPP的設定的常用埠,包含http和https的埠都被佔用了。

解決辦法

  1. 開啟XAMPP的控制面板,找到:Apache的Config檔案;
  2. 先開啟 Apache(httpd.conf),找到:Listen 80 替換成:Listen 8080;找到:ServerName localhost:80 替換成:ServerName localhost:8080;儲存。
  3. 再開啟Apache(httpd-ssl.conf),找到:Listen 443 替換成:Listen 4433;找到:和 ServerName localhost:443 替換成:和 ServerName localhost:4433;儲存。(本人配置檔案中未找到ServerName localhost:443,而是ServerName www.example.com:443,總之相應的改掉埠就可以。)
  4. 關閉XAMPP,重新開啟,再啟動Apache就不會有問題了。

這裡寫圖片描述