我試圖將本地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