我试图将本地windows计算机上的documentroot更改为指向htdocs下面的子目录。我已经改变了httpd.conf中的DocumentRoot位置以及目录位置。我重新启动了Apache,但用PHP打印出文档根目录,它仍指向默认位置。在Windows上更改apache的documentroot无法正常工作
httpd.conf中的变化:
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/folder_test/website"
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/folder_test/website">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
当我浏览到http://localhost/folder_test/website我看到我的PHP输出如下:
C:/Program Files/Apache Software Foundation/Apache2.2/htdocs
我的PHP代码:
<?php
//Get the document root
$root = getenv("DOCUMENT_ROOT") ;
Echo $root;
?>
我重新启动了Apache ...我错过了什么?
数百主题这次终于为我工作搜索后!谢谢。 – decadenza 2015-04-13 11:10:56