1. 程式人生 > 實用技巧 >XAMPP配置httpd-vhosts.conf後無法啟動

XAMPP配置httpd-vhosts.conf後無法啟動

apache開啟Include conf/extra/httpd-vhosts.conf,就無法起動

XAMPP用於安裝部署PHP工程還是很方便的,不過今天碰到一個無法啟動apache伺服器的問題。


XAMPP配置站點的檔案為:httpd-vhosts.conf,配置格式如下,

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot "程式帶訪問也的路徑"

ServerName www.dev.com (自己命名)

ErrorLog "logs/dummy-host2.localhost-error_log"

CustomLog "D:/xampp_log/VendorPlatform.log" combined

<Directory "程式帶訪問也的路徑">

DirectoryIndex index.php index.htm index.shtml index.html (訪問頁的檔名)

Options Includes FollowSymLinks ExecCGI

AllowOverride All

Allow from all

</Directory>

</VirtualHost>

但是,我在本地配置了後總是訪問不了,

報如下錯誤:

[Apache] Error: Apache shutdown unexpectedly.

[Apache] This may be due to a blocked port, missing dependencies,

[Apache] improper privileges, a crash, or a shutdown by another method.

[Apache] Press the Logs button to view error logs and check

[Apache] the Windows Event Viewer for more clues

[Apache]

If you need more help, copy and post this

[Apache] entire log window on the forums

根據網上查了下,還修改了埠。

修改埠的操作如下,

1、修改如下兩個埠

wKiom1hiNEzg3jX-AAGcorbozuA659.png-wh_50

2、開啟如下兩個配置檔案,將裡面的1中原有埠全部修改為1中修改後的埠

wKioL1hiNF2j3i_3AADxTU8QCNc734.png-wh_50

修改成功後,還是訪問不了配置的站點。於是又找到一個網上的解決辦法,將 CustomLog "D:/xampp_log/VendorPlatform.log" combined這一段全部刪掉,於是可以訪問了。


轉載於:https://blog.51cto.com/yangyoushan/1886614