欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php 在windows下配置虚拟目录的步骤

程序员文章站 2022-05-22 14:41:38
...
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  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看看

php 在windows下配置虚拟目录的步骤

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频


网友评论

文明上网理性发言,请遵守 新闻评论服务协议

我要评论
  • php 在windows下配置虚拟目录的步骤
  • 专题推荐