We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Model Could not be loaded

Hi everyone. I have a problem and I do not know what else to do.

I have a local vm with linux ubuntu, php 5.5 and phalcon 2.0.8 installed. And my application works perfectly. Is a Multi Module ( Backend/Frontend). Ok. On backend, Module.php, i registered namespaces how:

$loader = new Loader();

$loader->registerNamespaces(
  array(
  'Application\Backend\Controllers' => $config->application->controllersDir,
  'Application\Backend\Models' => $config->application->modelsDir,
  'Application\Backend\Plugins' => $config->application->pluginsDir,
  'Application\System' => $config->application->systemDir,
  )
);

$loader->register();

On my local vm, all works perfectly. But when i try execute my application on Amazon(ubuntu, php 5.5, phalcon 2.0.8, to) i receive this error:

"Model 'Application\System\Library\LanguageModel' could not be loaded"

For all Classes on System\Library, i receive the same error. Someone can help me? Why on my local vm works perfectly and on amazon server this broke?

Thanks very much!



85.5k

what's behaind door number 1 : $config->application->systemDir ?

did you try with full path ?

/var/www/html/private/modules/backend/models/

including both slases at the start and at the end.

and just in case your file should be named exacly: LanguageModel.php



2.7k
edited Nov '15

Hi, Izo. Thanks for answer. $config->application->systemDir = DIR . '/../../system/'

How i said, the problem occurs only on namespace Application\System. For Application\Backend\Models, for example, its ok.

And file its named exacly LanguageModel.php. For all files in system/library/ * occurs this error

what's behaind door number 1 : $config->application->systemDir ?

did you try with full path ?

/var/www/html/private/modules/backend/models/

including both slases at the start and at the end.

and just in case your file should be named exacly: LanguageModel.php