Automatic model loading does not work in CodeIgniter

advertisements

So I'm autoloading models like this:

$autoload['model'] = array('user_model','article_model','settings_model','authenticate_model');

And I have next files:

models/user_model.php:

<?php
class User_model extends CI_Model {

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

}

?>

And next error appears:

Unable to locate the model you have specified: User_model

And if access this file directly:

You don't have permission to access /application/models/user_model.php on this server.

So what can be causing the problem?


As @BeatAlex Said, it was the issue with the first letter of my models being in lower case. But for some reason when I was changing the name before, and pushing it with git using this command:

git commit -a -m "broke everythink"; git push heroku master

It wasn't changing the name of the file.

I had to delete the files, push changes, and then create them again and push them again, and now it's working.