我剛開始學習PHP,我試圖通過使用XAMPP在本地託管我自己的PHP網站。阿帕奇虛擬主機404找不到
我想創造的虛擬主機有:
網址:myphpwebsite.local
端口:8088
但是,當我試圖通過瀏覽器訪問這個網站我有一個:
未找到 HTTP錯誤404。未找到請求的資源。
有誰知道這個問題是什麼?
我的httpd-vhosts.conf
NameVirtualHost 127.0.0.1:8088
<VirtualHost 127.0.0.1:8088>
DocumentRoot "C:/xampp/htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost myphpwebsite.local>
DocumentRoot "C:/Microsoft/Workspace/myphpwebsite"
ServerName myphpwebsite.local
ErrorLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.error.log"
CustomLog "C:/Microsoft/Workspace/myphpwebsite/logs/myphpwebsite.local.custom.log" combined
<Directory "C:/Microsoft/Workspace/myphpwebsite">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
而我的C:\ WINDOWS \ SYSTEM32 \ DRIVERS \ ETC \ hosts文件:
127.0.0.1 localhost
127.0.0.1 myphpwebsite.local
任何幫助,將不勝感激!
@Avil如果這仍然不起作用,確保你的'DocumentRoot'的文件夾確實存在,'Listen 8088'在你的httpd.conf中。我犯了更嚴重的錯誤。 :) –