2014-10-19 67 views
0

我已經在我的電腦上安裝了wamp服務器,我需要在相對路徑上設置文檔根網址。我需要這種形狀地址URL的:更改本地主機文檔根

//當我使用文檔根目錄指令__DIR__我想要得到的輸出像波紋管

//輸出

http://localhost/ 

它的可能嗎?謝謝

回答

0

我覺得你有點困惑。如果你想有一個PHP語法,將返回你的DocumentRoot不管它是從哪裏使用稱爲__DIR__命令做到這一點(從手動)

The directory of the file. 
If used inside an include, the directory of the included file is returned. 
This is equivalent to dirname(__FILE__). 
This directory name does not have a trailing slash unless it is the root directory. 

$_SERVER["DOCUMENT_ROOT"]