PHP에서 클래스를 자동로드하는 중에 문제가 있습니다. 에서PHP : 자동로드 클래스를 찾을 수 없습니다.
내 index.php
내가 (즉, simpliest 하나) 쓰기 :
function _autoload($class_name) {
require_once $class_name . '.php';
}
$a = new Cont();
내 Cont.php
파일이 PROJECT_ROOT/assets/core/Contr.php
에 있습니다; 내 index.php
파일에 치명적인 오류가 발생 결과
: 당신이 밑줄 문자를 놓친처럼
Fatal error: Class 'Cont' not found in /var/www/bill/index.php on line 15
예. 바보 같은 실수를 해줘서 고마워. 누락 된 밑줄을 발견하지 못했다. –