Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-06-13 11:44:53
Original
1004 people have browsed it

先打开Apache的conf目录下的httpd.conf文件,在末尾添加如下代码:

复制代码 代码如下:



 ServerName www.mydemo.com
 DocumentRoot "D:/mydemo"

 Options FollowSymLinks IncludesNOEXEC Indexes
 DirectoryIndex index.html index.htm default.htm index.php default.php index.cgi default.cgi index.pl default.pl index.shtml
 AllowOverride Options FileInfo
 Order Deny,Allow
 Allow from all



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

复制代码 代码如下:


127.0.0.1 www.mydemo.com


然后再创建D:\mydemo目录
再然后重启一下apache服务器。
在浏览器输入www.mydemo.com看看
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!