I have build a custom MVC Framework. Local its working fine, when I try to get it working on a live shared hosting server I will get this error:
Error Message in Browser:
Fatal error: Uncaught Error: Class 'App\Config' not found in /www/htdocs/user/project/public/index.php:19 Stack trace: #0 {main} thrown in /www/htdocs/user/project/public/index.php on line 19
Composer.json file:
{
"require": {
"filp/whoops": "^2.3",
"phpmailer/phpmailer": "^6.0"
},
"autoload": {
"psr-4": {
"Core\\": "core/",
"App\\": "app/"
}
}
}
My Folder & File structure: (The whole project is inside the folder: "project")
Index.php File
<?php
/**
* Front controller
*/
use App\Config;
/**
* Composer autoloading
*/
require dirname(__DIR__) . '/vendor/autoload.php';
/**
* Whoops Error and Exception handling
*/
if (Config::SHOW_ERRORS == true){
$whoops = new \Whoops\Run;
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler);
$whoops->register();
}
/**
* Sessions
*/
session_start();
/**
* Routing
*/
$router = new Core\Router();
// Add the routes
$router->add('', ['controller' => 'Home', 'action' => 'index']);
Config.php file:
<?php
/**
* Application configuration
*/
namespace App;
class Config {
/**
* Database host
* @var string
*/
const DB_HOST = 'localhost';
/**
* Mail SMTP Port
* @var int
*/
const SMTP_PORT = '2525';
}
My method to deploy to the server:
- ZIP the local files & Export mysql database
- upload zip to server -> unzip it
- upload db to phpmyadmin
- Change database credentials in Config File
- run
composer install(I also tried:composer install --no-dev) - Done
I have repeated this procedure for several times now but its still not working

composer dump-autoload- Saad Suriapp/vsApp/) - brombeer