In: General
25 Sep 2008For 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.
4 Responses to How to fix Unable to locate the model you have specified message in CI
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.
Jay
June 10th, 2009 at 5:39 pm
Thank you! That save me a lotta time.
jay
June 15th, 2009 at 5:41 pm
This definitely saved me a lot of time. Cheers!
pat
July 2nd, 2009 at 2:08 pm
Thnx!
Saved me a lot of time too!