Codeigniter An unrelated exception was encountered Type: RuntimeException does not work on Linux server
Building a website using codeigniter . All codes work in (XAMPP) . localhost
But the same code fails on server Linux
showing error like
An unrelated exception was caught
Type: RuntimeException
Message: Could not find the specified model: Admin_user
File name: /home/capitalw/public_html/domain/system/core/Loader.php
Line number: 344
Backtrace:
File: /home/capitalw/public_html/domain/application/controllers/Admin.php Line: 10 Function: model
File: /home/capitalw/public_html/domain/index.php Line: 315 Function: require_once
Here are my codes
applications / controller / admin.php
class Admin extends CI_Controller {
public function __construct(){
parent::__construct();
//$this->load->library('common');
$this->load->library('form_validation');
$this->load->model('admin_user');
}
}
applications / models / admin_user.php
class Admin_user extends CI_Model {
function __construct()
{
parent::__construct();
}
//some inser update codes here
}
source to share
Make sure your file names and classes start with only the first letter. Upper case . The rest are lowercase letters. https://www.codeigniter.com/user_guide/general/styleguide.html#file-naming
Admin_user.php
Not
admin_user.php
https://www.codeigniter.com/user_guide/general/styleguide.html#class-and-method-naming
source to share