로드, 내가하지 :CodeIgniter는 내 컨트롤러 (컨트롤러/user.php)에서 모델
내 모델 (모델/user_model.php)에서class User extends CI_Controller
{
public function index()
{
$this->load->model('user_model')or die("error");
}
}
, 나는
class User_model extends CI_Model
{
public function __construct()
{
parent::__construct();
$this->load->database();
$this->load->helper('common');
}
}
만약이 I
or die("error");
로드 명령문에서 500 개의 내부 서버 오류가 발생합니다.
여기 config.php를 확인하고는 나는 또한 청소기를 만들기 위해 URL에서 "index.php에"를 제거 할 수있는 htaccess로 파일을 편집 한 몇 가지 정보
$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
에게 있습니다. 그것은 말한다
RewriteEngine On
RewriteCond $1 !^(index.php|images|captcha|css|js|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
로컬 호스트 또는 테스트/라이브 사이트를 온라인 상태로 만들었습니까? – sinisake
지금 당장 로컬에서 테스트하고 있습니다. MAMP – Lance
'$ this-> load-> model ('user_model') 또는 die ("error")를 제거하고 echo 'a'; 출구; 'a'를 주면 문제가 모델과 관련됩니다. application/config/database.php에서 구성을 확인하려면 다음 단계로해야합니다. $ this-> load-> database(); (도우미를로드하기 전에) 데이터베이스 연결인지 확인하십시오. – galchen