我正在尝试将本地Windows机器上的DocumentRoot更改为指向htdocs下的子目录。我已经在httpd.conf中更改了DocumentRoot位置以及Directory位置。我已经重新启动了Apache,但使用PHP打印出的文档根仍然指向默认位置。
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… 我还缺少什么吗?