PHP 配置虛擬網域名稱訪問

2021-08-08 05:38:35 字數 994 閱讀 1257

本內容分以下幾個步驟:

1、首頁我們得找到host檔案、這個檔案在c盤中

windows\system32\drivers\etc\hosts

在該檔案中插入:

[php]view plain

copy

print?

# localhost name resolution is handled within dns itself.  

#   127.0.0.1       localhost  

#   ::1             localhost  

127.0.0.1       localhost  

127.0.0.2 www.emswxh.com  

127.0.0.3 www.xiu.com  

2、然後咱們得去找httpd.conf檔案、這個檔案相應位置在您伺服器安裝的目錄下/\apache\conf\httpd.conf , 找到

「include conf/extra/httpd-vhosts.conf如果前面有# 則需要把它刪掉

3、找到httpd-vhosts.conf檔案

然後新增以下內容

[php]view plain

copy

print?

serveradmin [email protected]  

documentroot "e:/m1905/ems"

//這個為您的專案目錄

servername www.emswxh.com                       //這個為您在host中配置

errorlog "logs/dummy-host2.example.com-error.log"

customlog "logs/dummy-host2.example.com-access.log" common  

然後重啟伺服器就可以了

php學習 本地配置虛擬網域名稱

整合環境phpstudy apache php5.4 apache配置虛擬網域名稱首先是在httpd conf裡注釋掉 開啟vhost conf serveradmin admin phpstudy.net documentroot 根目錄 servername 網域名稱 options index...

PHP的虛擬網域名稱的配置

第一步 開啟apace的安裝檔案的所在地,到conf目錄下找到htpd.conf,並雙擊開啟。將516行前的 號去掉 第二步 開啟windows資料夾下面的system32下的drivers下面的etc資料夾,在etc檔案下雙擊開啟hosts 我在電腦裡面的檔案位置c windows system3...

apache本機環境配置虛擬訪問網域名稱

本文章將講述如何配置本地網域名稱訪問。1 開啟 apachedir conf httpd.conf,找到 把第二行前面的注釋去掉,這樣就可以通過修改httpd vhosts.conf檔案來達到配置虛擬主機的目的。2 然後在httpd vhosts.conf檔案內容配置如下內容 serveradmin...