2014-10-19 4 views
0

내 컴퓨터에 wamp 서버를 설치 했으므로 상대 경로에 문서 루트 URL을 설정해야합니다.로컬 호스트 문서 루트 변경

// 내가 문서 루트 지시어 __DIR__를 사용할 때이 같은 출력을 얻을 싶어 우는 소리

// 출력

http://localhost/ 

그것의 수 : 나는 주소 URL의 모양을해야합니까? 감사합니다

답변

0

나는 당신이 조금 혼란 스럽다고 생각합니다. 당신이 관계없이 사용에서 호출되는 위치에 당신 DocumentRoot의 반환하는 PHP 구문을 원하는 경우 __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"]