PHP在本機(jī)設(shè)置虛擬主機(jī)
時(shí)間:2023-07-15 22:03:01 | 來源:網(wǎng)站運(yùn)營(yíng)
時(shí)間:2023-07-15 22:03:01 來源:網(wǎng)站運(yùn)營(yíng)
PHP在本機(jī)設(shè)置虛擬主機(jī):
- 找到C:/Windows/System32/drivers/etc下的hosts文件進(jìn)行修改,在文件最后添加
127.0.0.1 www.tp5.com
2.
打開httpd.conf文件,修改
#Include conf/extra/httpd-vhosts.conf 把#號(hào)去掉
打開此處文件,修改
添加如下內(nèi)容:
<VirtualHost *:80>
ServerName www.tp5.com
DocumentRoot D:/phpStudy/WWW/tp5/public
<Directory "D:/phpStudy/WWW/tp5/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
Require all granted
</Directory>
</VirtualHost>
重點(diǎn):重啟phpstudy軟件,然后再重啟服務(wù)再在瀏覽器中輸入:
http://www.tp5.com出現(xiàn)如上圖,就代表配置成功了
關(guān)鍵詞:虛擬,主機(jī),設(shè)置