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,什么这地方不好用,那地方不好用的。其实严格地说起来,没有一门语言好用,也没有一门语言有一个严格的标准,凡事都有一个发展的过程,我们总不能等这些标准呀什么的都很完善...

探究Laravel使用env函数读取环境变量为null的问题

探究Laravel使用env函数读取环境变量为null的问题

发现问题 在 Laravel 项目中,如果执行了 php artisan config:cache 命令把配置文件缓存起来后,在 Tinker 中(Tinker 是 Laravel 自带...

PHP获取Exif缩略图的方法

本文实例讲述了PHP获取Exif缩略图的方法。分享给大家供大家参考。具体实现方法如下: // file to read $file = 'test.jpg'; $image = ex...

php多重接口的实现方法

本文实例讲述了php多重接口的实现方法。分享给大家供大家参考。具体如下: <?php interface staff_i1 //接口1 { func...

PHP 简单日历实现代码

PHP 简单日历实现代码

复制代码 代码如下:<?php $monthoneday=date("Ym")."01"; $oneweekday=date("w",strtotime($monthoneday)...