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

yipeiwu_com6年前PHP代码库
先打开Apache的conf目录下的httpd.conf文件,在末尾添加如下代码:
复制代码 代码如下:

<VirtualHost *:80>
 ServerName www.mydemo.com
 DocumentRoot "D:/mydemo"
<Directory "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
</Directory>
</VirtualHost>

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

127.0.0.1 www.mydemo.com

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

相关文章

php中随机显示图片的函数代码

例如博客的展示窗 复制代码 代码如下: <?php /********************************************** * Filename : img...

php实现用于计算执行时间的类实例

本文实例讲述了php实现用于计算执行时间的类。分享给大家供大家参考。具体如下: 有了这个php类,计算函数或者一段代码的执行时间就简单了 <?php class c_...

php使用array_search函数实现数组查找的方法

本文实例讲述了php使用array_search函数实现数组查找的方法。分享给大家供大家参考。具体实现方法如下: <?php $array = array(4,5,7,...

PHP数组编码gbk与utf8互相转换的两种方法

一、利用var_export(), eval()方法 /** * 将含有GBK的中文数组转为utf-8 * * @param array $arr 数组 * @para...

PHP 循环列出目录内容的函数代码

复制代码 代码如下: function list_files($dir) { if(is_dir($dir)) { if($handle = opendir($dir)) { while...