采用了Wampserver安装了php的运行环境,而且安装在c盘目录下。可是我想把项目放在e盘,而且配置好虚拟目录。php
1)directory改为下面的apache
<Directory />浏览器
Options Indexeside
AllowOverride Noneserver
Order allow,denyget
Allow from allio
</Directory>配置
2)在Listen 0.0.0.0:8080(个人监听端口是8080,不是默认的80)下面新增一条记录List
Listen 0.0.0.0:8081(监听8081端口)error
#Include conf/extra/httpd-vhosts.conf 去掉前面的#。
打开添加
<VirtualHost *:8081>
DocumentRoot "E:/php/xxxt"
ServerName myvirtualhost.com
ErrorLog "logs/myvirtualhost.com-error.log"
CustomLog "logs/myvirtualhost.com-access.log" common
</VirtualHost>
其中E:/php/xxxt的路径必须是全英文的,不能有中文汉字,不然在访问的时候会报错。
3.重启Apache,在浏览器中访问http://localhost:8081/index.php就能够了。