How to fix Unable to locate the model you have specified message in CI

In: General

25 Sep 2008

For the last few days I have been working on a project based on CodeIgniter framework. As this was my first CodeIgniter application, problems were bound to show up. It was just a matter of time. My developer machine is powered by Windows XP, and my working environment is based on WAMP version 2.0 that comes packed with PHP 5.2.6. Installing CodeIgnites was a peace of cake.

After few days of development, time has come to move the application to the server where it will be accessed by other developers trough SVN. Deploying was rather painful since I overlooked the obvious. Server that was hosting the files was on Linux. It is know fact that Windows and Linux look at files a bit differently. The thing is, my CodeIgniter application got loaded as far as to the first $this->load->model(’SomeModelName’) part.

All i got was the annoying error Unable to locate the model you have specified. After about an hour of hunting for bugs I realized it was not a bug, just a naming convention problem. It was not actually a in a real sense of a word. For all of you with the same problem, all you need to do is to rename your modul and library names to be lowercase.

Here are some screen shot on how the name of the models should look lika, as well on how the class names and function calls should look like. Just remember, if you start getting this error, then it’s letter case related. Hope this saves someone couple of minutes of their lives.

Interesting? Share it!
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • Facebook
  • TwitThis
  • description

4 Responses to How to fix Unable to locate the model you have specified message in CI

Avatar

Amrit

May 12th, 2009 at 12:16 am

Thanks…..
i am facing same problem..Now i m going to change all the module name in lowercase…
Thanks Again.

Avatar

Jay

June 10th, 2009 at 5:39 pm

Thank you! That save me a lotta time.

Avatar

jay

June 15th, 2009 at 5:41 pm

This definitely saved me a lot of time. Cheers!

Avatar

pat

July 2nd, 2009 at 2:08 pm

Thnx!
Saved me a lot of time too!

Comment Form

About this site

Branko Ajzele Welcome to ActiveCodeline. My name is Branko Ajzele. I'm 26-year-old, currently working as full time PHP web application developer at Inchoo (in partnership with Surgeworks). My special interest and expertise evolve mainly around Zend Framework, Doctrine ORM, Magento eCommerce platform and few other related technologies.

More about me?
View Branko Ajzele's profile on LinkedIn
  • Uwe Stoll: Thanks for your valuable advice. Furthermore, I found it be important to use the backend generated [...]
  • Danny: Ah. I think I figured it out.. But 1 thing.. How can I have it appear at just the home page and on t [...]
  • Danny: I've set everything up as instructed on this page, but it still doesn't show up on the front page... [...]
  • Chris: [code] true local [/code] [...]
  • Chris: Looks like the author forgot to include a pool to which the code comes from. local or community. [...]

Categories