![](/img/trans.png)
[英]The requested URL could not be retrieved while trying to access Laravel project on Virtual Host with XAMPP
[英]The requested URL could not be retrieved while trying to access Laravel project on Virtual Host
我想用 XAMPP 為我的 Laravel 項目創建一個虛擬主機,所以我按照以下步驟操作:
步驟 1) C:\\WINDOWS\\system32\\drivers\\etc\\
打開“hosts”文件(以管理員身份):
127.0.0.1 localhost
127.0.0.1 test.com
步驟 2) xampp\\apache\\conf\\extra\\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "C:/Users/User 1/Desktop/POUYA/freedeliveries" <= PROJECT DIRECTORY
ServerName www.test.com
</VirtualHost>
步驟 3) C:\\xampp\\apache\\conf\\httpd.conf
。 向下滾動到最后的Supplemental configuration部分,找到以下部分(大約第 500 行),從第二行的開頭刪除#
,因此該部分現在看起來像這樣:
#Virtual hosts
Include conf/extra/httpd-vhosts.conf
第 4 步)重新啟動 XAMPP,現在在我的瀏覽器中運行它:
www.test.com
但現在我得到了這個結果:
錯誤 無法檢索請求的 URL
The following error was encountered while trying to retrieve the URL: http://test.com/
Unable to determine IP address from hostname test.com
The DNS server returned:
Name Error: The domain name does not exist.
This means that the cache was not able to resolve the hostname presented in the URL. Check if the address is correct.
Your cache administrator is root.
那么如何解決這個問題並在虛擬主機名上運行 Laravel 項目呢?
你的第2步有問題把ServerName改成test.com
這兩個鏈接將幫助您更多
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.