I have a project on my localhost that works flawlessly, I uploaded the project to a cPanel server on Hostgator, update php to version 7.0 so everything works ok, I uploaded it to a folder and created a subdomain pointing to the folderpublic
But when I enter the subdomain directly, it gives me the following error:
Zend\Mvc\Controller\ControllerManager::createFromInvokable: failed retrieving "appscontrollerindex(alias: Apps\Controller\Index)" via invokable class "Apps\Controller\IndexController"; class does not exist
Then try to go to the authentication controller and it throws me the following error:
Fatal error: Uncaught Error: Class 'Users\Model\Users' not found ...
-- UPDATE 1 ---
In the Authentication module, I define the controller in the file like this module.config.php
:
'controllers' => array(
'invokables' => array(
'Authentication\Controller\Index' => 'Authentication\Controller\IndexController'
),
),
IndexController
And in the Authentication module file , this line includes the Users class:
use Users\Model\Users;
And then inside an action I call it like this:
$this->dbAdapter =$this->getServiceLocator()->get('Zend\Db\Adapter');
$users = new Users($this->dbAdapter);
-- UPDATE 2 ---
I was doing everything possible to make it work, I contacted Hostagtor technical support and they told me that the reseller and web plans are not compatible with ZF2 and that is why they did not work. So I'm looking for another server that even has a tutorial to install ZF2
The symptoms point ( for now ) to setting the
getAutoloaderConfig()
inside ofModule.php
.But this usually throws errors if different directory structures than the classic one are used
skeleton
and it has not been configured correctly.Example:
Basic Structure
Autoloader settings in
Module.php
Theory
For a previous question I noticed that you had the type structure:
So the autoloader configuration in
Module.php
should be like this:I think you should review the configuration of each
Module.php
and verify that they actually point correctly to the structure so that theynamespaces
respond properly.Coinciding with this, it may be the reason why it does not recognize the model
Users\Model\Users
.Reproduce the error locally
As an exercise if you want to check the error in the local application you have, in any
Module.php
test to change:By:
It should give the same error you are asking about.