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

denisgillier's avatar

Systemic DB error during and after Composer install ???

Hello, I'm pretty new to Laravel and I'm trying to deploy my app on EC2 (from github). After doing a git clone and filling up the .env file, I'm doing a composer install...

Everything seems to be installed correctly but at the end of it I'm having the following :

@php artisan package:discover --ansi

   Illuminate\Database\QueryException 

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bms0.languages' doesn't exist (SQL: select * from `languages` where `languages`.`deleted_at` is null)

Looks like composer install is expecting a DB with existing tables (and of course I haven't done artisan migrate yet)... And whatever composer or php artisan command I'm doing thereafter is generating the same error again ???


  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bms0.languages' doesn't exist (SQL: select * from `languages` where `languages`.`deleted_at` is null)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671

Any idea of what's going on ?

Thanks for your precious help, Denis

0 likes
4 replies
bobbybouwmann's avatar
Level 88

It seems that one of your service providers is hard wired to some database call. Because of this, composer won't be able to autoload those files.

You can find try to migrate the database and then run composer install again to see that it works. You would have to do this manually on the server using the command line.

In general, your ServiceProvider shouldn't need access to the database. You should look for the usage of this table and refactor that to a different solution ;)

2 likes
denisgillier's avatar

Thanks !

I already tried to run php artisan migrate, but it also fails for probably the same reason...

denisgillier's avatar

Thanks ! Found a call to DB in AppServiceProvider boot() function...

Did not know this was called during installation !

2 likes

Please or to participate in this conversation.