Windows 10 全新安裝 XAMPP 後,Apache 模組啟動失敗,錯誤日誌提示「Port 80/443 被佔用、權限不足、崩潰或被其他方式關閉」。主因是 Windows 10 系統服務(World Wide Web Publishing Service / IIS / BranchCache)預設佔用 80/443 埠。修改 Apache 設定檔將監聽埠改為未被佔用的替代埠(如 8080/8443 或 82/4433)即可解決。


System (PID 4) 佔用,Port 443 可能被 vmware-hostd.exe 或其他服務佔用。C:\xampp\apache\conf\httpd.conf(路徑視安裝位置調整)。80 為 82(或 8080、8888 等未被佔用埠):Listen 80 → Listen 82ServerName localhost:80 → ServerName localhost:82<VirtualHost *:80> → <VirtualHost *:82>


C:\xampp\apache\conf\extra\httpd-vhosts.conf。:80 修改為 :82(含 NameVirtualHost *:80、<VirtualHost *:80>)。
C:\xampp\apache\conf\extra\httpd-ssl.conf。Listen 443 → 註解或修改:#Listen 443 或 Listen 4433。<VirtualHost _default_:443> → <VirtualHost _default_:4433>。ServerName www.example.com:443 → ServerName www.example.com:4433。

82, 4433(或您設定的埠),即表示啟動成功。
https://localhost:82/ 或 https://127.0.0.1:82/https://localhost:4433/(需接受自簽憑證警告)https://localhost:82/phpmyadmin/services.msc → 找到 World Wide Web Publishing Service、BranchCache → 停用並設為「手動」或「停用」。修改 XAMPP Apache 設定檔埠號是最安全、不影響系統服務的解決方案,Win10 開發環境即刻就緒!