Fatal Error: Class 'CI_Model' not found

2019-03-03 23:46发布

问题:

All of a sudden my pages on my web-server are failing. Everything works brilliantly locally.

Errors in question

[Wed Sep 12 03:37:49 2012] [error] [client _______] PHP Fatal error:  Class 'CI_Model' not found in /home/webuser/public_html/website.com/public/application/models/userModel.php on line 2

Opening lines of userModel.php

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class UserModel extends CI_Model{

This has been working all up until today when I did a recent code pull. Which was only changes to views, controllers and this particular module.

回答1:

It's obviously not being able to find the class CI_Model which should be in system/core/Model.php.

Make sure the file is still there and the filename hasn't changed for some reason, and that there is no typo within the file.

Finally, in the main index.php (the one that resides outside of application and system directories), make sure $system_path is set correctly.