php 在windows下配置虛擬目錄的方法,php虛擬目錄
1.先找到apache的設定檔 httpd.conf 找如如下代碼:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
把# Include conf/extra/httpd-vhosts.conf 去掉#號,如下:
Include conf/extra/httpd-vhosts.conf
儲存。
2.開啟 Apache 的 conf 目錄下的 extra 檔案夾下的 httpd-vhosts.conf 檔案,用記事本開啟,在末尾加入以下代碼:
1 2 ServerName www.mydemo.com 3 DocumentRoot "D:/mydemo" 4 5 Options FollowSymLinks IncludesNOEXEC Indexes 6 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml 7 AllowOverride Options FileInfo 8 Order Deny,Allow 9 Allow from all10 11
3.再到C:->Windows->System32->drivers->etc目錄,開啟hosts檔案。
在末尾添加如下代碼:
1 127.0.0.1 www.mydemo.com
然後再建立D:\mydemo目錄
再然後重啟一下apache伺服器。
在瀏覽器輸入www.mydemo.com看看
http://www.bkjia.com/PHPjc/1048750.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1048750.htmlTechArticlephp 在windows下配置虛擬目錄的方法,php虛擬目錄 1.先找到apache的設定檔 httpd.conf 找如如下代碼: # Virtual hosts #Include conf/extra/httpd-vhosts.co...