include_once();
경로를 시작 디렉토리에서 시작하여 경로를 찾는 방법을 찾으려고합니다. ../../../path/to/file
대신 /path/to/file
이 필요합니다. 나는 그것이 그런 파일이나 디렉토리가 말한다 /path/to/file
그렇게 할 경우 아파치 서버에게있는 경우, 여기 PHP include_once 경로
"/assets/page_assets.php"
<?php
include_once($_SERVER['DOCUMENT_ROOT'] . "/assets/page_assets.php");
?>
하지의 루트 폴더에서,
from the root of the disk
의미 내 직접 코드
<?php
include_once("/assets/page_assets.php");
?>
'경로의 시작 :
그러나 명랑 코멘트에서 언급 한 바와 같이, 당신은 당신의 최고의 슬래시없이 파일을 포함해야
웹 서버의 루트? '/ path/to/file'은 파일 시스템의 루트 경로입니다! – Cheery