php默认的根目录是安装Apache的目录。
你可以试试把conf/httpd文件中的DocumentRoot改为C:/php/test

解决方案 »

  1.   

    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>
      

  2.   

    我是这么做的啊
    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
      

  3.   

    访问c:/php/test里的html文件是可以的,但是只要一访问php文件就报那个错,到底该怎么设置虚拟路径啊!救救我啊!!!
      

  4.   

    html本来就是可以的啊。
    还是设置目录的路径不对,没有解释PHP文件