I have a Laravel 9 project which works fine on local, but after uploading it to the online server I get this error :
Fatal error: Uncaught ReflectionException: Class "config" does not exist in /.../vendor/laravel/framework/src/Illuminate/Container/Container.php:875 Stack trace: #0
This project is not in the root folder but inside another folder, because I have multiple laravel projects. The other one laravel 8.8 is working fine.
That's what I've tried so far:
$ php artisan optimize:clear
composer install
composer dump-autoload
php artisan cache:clear
php artisan config:clear
I solved this issue. I had some missing php extensions on the server. Installing them solved the issue.
Check the Laravel 9 System Requirements here in their doc.
run this code on your server to see your installed extensions and install everything that is missing.
<?php
echo "<pre>";
print_r(get_loaded_extensions());
echo "<pre/>";