Error Codeigniter, How to fix it?

0

I am using codeigniter to develop, the problem is that when I already have the files on the server I get the following error ...

An uncaught Exception was encountered

Type: RuntimeException

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

Filename: /var/www/html/students/system/core/Loader.php

Line Number: 344

Backtrace:

File: /var/www/html/students/application/controllers/Home.php
Line: 10
Function: model

File: /var/www/html/students/index.php
Line: 315
Function: require_once

I hope you can help me that I have not been able to solve it, the app works very well locally.

I could say that soon the problem is ...
CONTROLLER

Class Home extends CI_Controller {

    public function __construct()
    {
        parent::__construct();
        $this->load->helper(array('url'));
        $this->load->model('home_model');       
    }

MODEL

Class Home_model extends CI_Model {

    function __construct() {
        parent::__construct();
        $this->db = $this->load->database('default', TRUE); 
    }
    
asked by JDavid 17.02.2017 в 15:48
source

1 answer

2

I have observed according to the code that you show, that you are developing in Linux ...

In that case, when you load the Codeigniter model, you should bear in mind that Linux is "case sensitive" and for the system the instruction

$this->load->model('home_model');

will be different from the instruction

$this->load->model('Home_model'); .

Check the name of the PHP file of the home_model (uppercase or lowercase)

I think your problem may come around.

Greetings

    
answered by 28.02.2017 / 23:20
source