Justin Erswell Justin Erswell - 1 year ago 287
PHP Question

Codeigniter 3 - Unable to locate the model you have specified

I am aware of the other questions on the platform for this issue however I am having a very unusual issue with this.

I have a model

which is being autoloaded in the
and the Class is built like this:

Class Company_Model extends CI_Model {

function __construct()

public function foo()
echo 'bar';

However I am still getting this error when I load the page:

Codeignter 3 - Unable to locate the model you have specified

I am running on Apache 2, PHP 5.5.9 on Ubuntu 14.04, I cannot find an error log for this issue and now I am baffled, any help would be gratefully recieved.

I have check the uppercasing and all of the other tips from StackOverflow but still no joy.


Auto load code

$autoload['model'] = array('company_model');

Answer Source

When you use codeigniter 3 you have to make sure your class names and file names only have the first letter upper case as explained here

Class Naming Style Guide

Filename Style Guide


class Company_model extends CI_Model {


And file name then should be Company_model.php

$autoload['model'] = array('company_model');

If in sub folder

models > sub folder > Company_model.php

$autoload['model'] = array('subfolder/company_model');

If need to call it on controller only



Sub folder


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download