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 的加密函数 md5,crypt,base64_encode 等使用介绍

不可逆的加密函数为:md5()、crypt() md5() 用来计算 MD5 哈稀。语法为:string md5(string str); crypt() 将字符串用 UNIX 的标准加...

php7安装openssl扩展方法

1、我的源码在 /home/topsec/Documents/php-7.0.11 ,安装位置在 /usr/local/php7, php.ini 在/ usr/local/php7/l...

php数组排序usort、uksort与sort函数用法

本文实例讲述了php数组排序usort、uksort与sort函数用法。分享给大家供大家参考。具体用法分析如下: 对数组排序:usort() 函数使用用户自定义的函数对数组排序,实例代码...

PHP提交表单失败后如何保留已经填写的信息

本文介绍PHP提交表单失败后如何保留填写的信息一些方法总结,其中最常用的就是使用缓存方式了,这种方法如果网速慢是可能出问题的,最好的办法就是使用ajax了。 1.使用header头设置缓...

Memcache 在PHP中的使用技巧

add($key, $value, $expiry); $key: 唯一标识, 用于区分写入的数据 $value: 要写入的数据 $expiry: 过期时间, 默认为永远有效 用途: 将...