Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

johnDoe220's avatar

Next Illuminate\Contracts\Container\BindingResolutionException: Target class [config] does not exist

give me this error when developing laravel project

Next Illuminate\Contracts\Container\BindingResolutionException: Target class [config] does not exist. in /home/my/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php:877
Stack trace:
#0 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(756): Illuminate\Container\Container->build('config')
#1 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(860): Illuminate\Container\Container->resolve('config', Array, true)
#2 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(692): Illuminate\Foundation\Application->resolve('config', Array)
#3 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(845): Illuminate\Container\Container->make('config', Array)
#4 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php(1419): Illuminate\Foundation\Application->make('config')
#5 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(521): Illuminate\Container\Container->offsetGet('config')
#6 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(572): Illuminate\Log\LogManager->getDefaultDriver()
#7 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(119): Illuminate\Log\LogManager->parseDriver(NULL)
#8 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(642): Illuminate\Log\LogManager->driver()
#9 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(274): Illuminate\Log\LogManager->error('Call to undefin...', Array)
#10 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(481): Illuminate\Foundation\Exceptions\Handler->report(Object(Error))
#11 /home/my/laravel/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(136): Illuminate\Foundation\Http\Kernel->reportException(Object(Error))
#12 /home/my/public_html/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#13 {main}
  thrown in /home/my/laravel/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 877

i use centos and cpanel

0 likes
17 replies
tykus's avatar

When/how is this happening?

johnDoe220's avatar

@tykus This error occurs when I enter the site address, for example test.com

tykus's avatar

@johnDoe220 in development environment / production? Did you install your dependencies?

johnDoe220's avatar

@tykus See, only the Laravel project has this problem. To test, I created a simple index.php file and it worked

tykus's avatar

@johnDoe220 well, only a Laravel project would throw a Illuminate\Contracts\Container\BindingResolutionException - so I don't know what that proved?

Does the server meet all of the requirements required by a Laravel installation?

johnDoe220's avatar

@tykus I mean, there is no problem in the server configuration and the problem is only with the Laravel project

tykus's avatar

@johnDoe220 how do you know this - are there other working Laravel projects on the same server?

there is no problem in the server configuration

Tray2's avatar

You have something wrong in your code.

johnDoe220's avatar

@Tray2 I thought like you, so I ran a raw Laravel project and still got this error

Tray2's avatar

@johnDoe220 With raw do you mean this?

composer create-project laravel/laravel my-project
Tray2's avatar

@johnDoe220 Ok, then.

  1. Have you installed all the required php modules?
  2. Have the correct permissions to the directories and files?
johnDoe220's avatar

@Tray2 I installed the latest version of php in cPanel and yes I gave permissions to the relevant files, this is the first time I encountered this problem after doing this hundreds of times.

Please or to participate in this conversation.