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 sprintf() 函数的应用(定义和用法)

语法sprintf(format,arg1,arg2,arg++) 参数 描述 format 必需。转换格式。 arg1 必需。规定插到 format 字符串中第一个 % 符号...

Yii中render和renderPartial的区别

以下由我们在信易网络公司开发项目的时候终结出的一些经验 在进行页面输出渲染的时候。 1.render 输出父模板的内容,将渲染的内容,嵌入父模板。| 2.renderPartial 则不...

PHP设置Cookie的HTTPONLY属性方法

httponly是微软对cookie做的扩展,这个主要是解决用户的cookie可能被盗用的问题。 大家都知道,当我们去邮箱或者论坛登陆后,服务器会写一些cookie到我们的浏览器,当下次...

PHP安装BCMath扩展的方法

PHP安装BCMath扩展的方法

编译安装 (PHP-5.6.23) 1.进入PHP源码包目录下的ext/bcmath目录。 [root@192 bcmath]# ls bcmath.c config.m4...

浅谈PHP安全防护之Web攻击

SQL注入攻击(SQL Injection) 攻击者把SQL命令插入到Web表单的输入域或页面请求的字符串,欺骗服务器执行恶意的SQL命令。在某些表单中,用户输入的内容直接用来构造(或者...