Mr.M Mr.M - 1 year ago 127
PHP Question

Slim working on localhost but gives "Fatal error: class not found" on shared host

I'm using Slim 3 to create an app. All works well in localhost (xampp) but when i try the same app on my shared host i get "fatal error: class not found" for each class called with use. Example:

login route

use \App\Middlewares\ValidationMiddleware;

$app->get('/login', 'AuthController:getSignIn')->setName('login')
->add(new ValidationMiddleware($container));

i get

Fatal error: Class 'App\Middlewares\ValidationMiddleware' not found

but the class is there and in localhost it works.

Where do you think is the problem ? Thanks.

Answer Source

check if all directories and files has correct capitalisation.

For linux directory or file with name Abc is not the same as abc, but for windows it is equal

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download