XAMPP 控制面板顯示 Apache started [port 80] 但狀態非 Running,實際端口仍佔用於舊進程。核心衝突源:系統服務 (IIS/W3SVC)、其他 Web 伺服器、SSL 443 端口佔用。本文提供「釋放端口」與「變更端口」雙軌解決方案,並附錯誤日誌定位技巧。
busy... Apache started [port 80]https://localhost 無法訪問netstat -ano | findstr :80 顯示 PID 非 Apachenetstat -ano | findstr :80
# 輸出範例:TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1236
tasklist | findstr 1236
# 或任務管理器 → 詳情 → PID 欄排序
常見佔用者:System (IIS/W3SVC)、httpd.exe (殘留 Apache)、nginx.exe、vmware-hostd.exe。
World Wide Web Publishing Service (W3SVC),設為「手動」或「禁用」。Running 綠燈。xampp\apache\conf\httpd.conf:
Listen 8081
ServerName localhost:8081
xampp\apache\conf\extra\httpd-ssl.conf (若啟用 SSL):
Listen 4433
<VirtualHost _default_:4433>
ServerName localhost:4433
httpd.conf 註釋:#Include conf/extra/httpd-ssl.confhttps://localhost:8081 驗證。現象說明: 面板仍可能顯示 Apache started [port 80],但實際監聽 8081,以瀏覽器實測為準。
若啟用 SSL 仍報 443 佔用:
當上述方法均無效,查看 xampp\apache\logs\error.log 末尾:
# 常見關鍵錯誤
(OS 10048)Only one usage of each socket address is permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:80
# 確認為端口佔用,回歸方案一
apache_start.bat 直接啟動,錯誤輸出直觀於控制台。端口衝突是 XAMPP Apache 啟動失敗 90% 以上原因,掌握 netstat -ano + 任務管理器 + error.log 三板斧,分鐘級定位解決。