Ramesh S
Ramesh S

Reputation: 804

codeigniter An uncaught Exception was encountered Type: RuntimeException not working in Linux server

Am creating a website using codeigniter. All the codes are working in localhost(XAMPP).

But same code not working in Linuxserver showing error like

An uncaught Exception was encountered

Type: RuntimeException

Message: Unable to locate the model you have specified: Admin_user

Filename: /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 my codes are

application/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');

    }
}

application/models/admin_user.php

class Admin_user extends CI_Model {

    function __construct()
    {
        parent::__construct();

    }
//some inser update codes here


}

Upvotes: 3

Views: 31031

Answers (2)

Tpojka
Tpojka

Reputation: 7111

Change file name

admin_model.php

to

Admin_model.php

Linux' file system is case sensitive.

Upvotes: 2

user4419336
user4419336

Reputation:

Make sure your filenames and classes start with First Letter Only Upper Case The rest lower case. 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

Upvotes: 2

Related Questions