1.php默认的根目录:在安装Apache的目录conf/httpd文件中的 DocumentRoot ;可改为你要的目录。 2.虚拟路径:添加在httpd文件中;用localhost/test/访问; test和test1: 可一样也可不一样。 Alias /test/ "$path$/test1/"<Directory "$path$/test1"> Options FollowSymLinks Indexes AllowOverride None Order deny,allow allow from 127.0.0.1 deny from all </Directory>
我是这么做的啊 Alias /test/ "C:/php/test/"<Directory "C:/php/test/"> Options FollowSymLinks Indexes AllowOverride None Order deny,allow allow from 127.0.0.1 deny from all </Directory> 可访问的时候还是报这个错误:Premature end of script headers: php.exe
DocumentRoot ;可改为你要的目录。
2.虚拟路径:添加在httpd文件中;用localhost/test/访问;
test和test1: 可一样也可不一样。
Alias /test/ "$path$/test1/"<Directory "$path$/test1">
Options FollowSymLinks Indexes
AllowOverride None
Order deny,allow
allow from 127.0.0.1
deny from all
</Directory>
Alias /test/ "C:/php/test/"<Directory "C:/php/test/">
Options FollowSymLinks Indexes
AllowOverride None
Order deny,allow
allow from 127.0.0.1
deny from all
</Directory>
可访问的时候还是报这个错误:Premature end of script headers: php.exe
还是设置目录的路径不对,没有解释PHP文件