The autoloader is case-sensitive (on Linux), so you need to use the same case for your class name wherever you use it. In your controller, you should have:
$login = new Default_Models_Login();
and your class should be defined as:
class Default_Models_Login
(note the capital 'D' and 'M' in both cases).
You also have your library folder on the include path twice (the first two paths listed are equivalent), so you might want to fix that too.
Edit: Apologies, I gave you some bad info. The standard autoloader (what you're using), expects to be able to find classes on the file system based on their class name only. Since it's case-sensitive on Linux, to fix your problem you would need to also change your default
folder to Default
, and models
to Models
. But this is likely to break other things. The standard autoloader is not designed for autoloading classes in the application
folder for this reason.
The best solution, assuming you want to stick with ZF conventions would be to use ZF's module autoloader (which is specifically designed for classes inside application/modules
). To do this, you need to:
Create a bootstrap file for your module. This file should live at application/modules/default/Bootstrap.php
and contain:
class Default_Bootstrap extends Zend_Application_Module_Bootstrap
{
}
You might also need to init the module resource by adding:
resources.modules[] =
to your application.ini
file.
This should setup the module autoloader for your default module. The module autoloader sets up a number of different resources by default (see the docs: http://framework.zend.com/manual/1.12/en/zend.loader.autoloader-resource.html#zend.loader.autoloader-resource.module), including one for models. However the default assumes your class name will use the word Model
rather than Models
. So you'll also need to change your class name to Default_Model_Login
(but leave the folder name as models
). Hopefully then it should all work!
All of this is about a 100 times easier in ZF2.