Mr.M Mr.M - 13 days ago 8
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($container->csrf)
->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

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