也可以建立个别名,在httpd.conf后面加 Alias /yoursite/ "c:path/to/your/web/site/" 以后把你的PHP文件放在这个目录下面 浏览的时候http://localshot/yoursite/index.php
DocumentRoot "H:/php/Apache2/htdocs"这个是默认的目录 以下是自己设置的虚拟目录,其中“H:/web/”可以设为自己的目录 Alias /web "H:/web/" <Directory "H:/web"> Options Indexes MultiViews AddOutputFilter Includes html AllowOverride None Order allow,deny Allow from all </Directory>
Alias /yoursite/ "c:path/to/your/web/site/"
以后把你的PHP文件放在这个目录下面
浏览的时候http://localshot/yoursite/index.php
以下是自己设置的虚拟目录,其中“H:/web/”可以设为自己的目录
Alias /web "H:/web/"
<Directory "H:/web">
Options Indexes MultiViews
AddOutputFilter Includes html
AllowOverride None
Order allow,deny
Allow from all
</Directory>
修改httpd.conf,修改下面两句话:1、DocumentRoot "d:/php"2、<Directory "d:/php">则ok。当然要重起apache
DocumentRoot "目录"
<Directory "目录">