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看看

相关文章

redis查看连接数及php模拟并发创建redis连接的方法

max_redis.php <?php set_time_limit (0); for($i=1;$i<=1050;$i++){ exec("nohup p...

Laravel SQL语句记录方式(推荐)

Laravel SQL语句记录方式(推荐)

打印sql语句,直接在你执行SQL语句后输出 方法一:  $queries = DB::getQueryLog();  $a = end($queries); &n...

PHP $_FILES中error返回值详解

$_FILES['file']['error']值 UPLOAD_ERR_OK: 0 //正常,上传成功 UPLOAD_ERR_INI_SIZE: 1 //上传文件大小超过服务器允许上传...

ThinkPHP自动转义存储富文本编辑器内容导致读取出错的解决方法

ThinkPHP的conf文件中的Convention.php有一个配置选项 'DEFAULT_FILTER'      &n...

快速配置PHPMyAdmin方法

    那么我们现在开始进行安装配置:     1.一般网上下载到的PHPMyAdmin是一个压缩包,我们...