2014-10-19 75 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"]