php 在windows下配置虚拟目录的方法

王朝学院·作者佚名  2016-05-24
窄屏简体版  字體: 小  |  中  |  大  |  超大  

php 在windows下配置虚拟目录的方法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 <VirtualHost *:80> 2 ServerName www.mydemo.com 3 DocumentRoot "D:/mydemo" 4 <Directory "D:/mydemo"> 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 </Directory>11 </VirtualHost>

3.再到C:->Windows->System32->drivers->etc目录,打开hosts文件。 在末尾添加如下代码:

1 127.0.0.1 www.mydemo.com

然后再创建D:\mydemo目录再然后重启一下apache服务器。在浏览器输入www.mydemo.com看看

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航