Laravel QueryException: could not find driver in Alpine Linux

Viewed 462

I'm trying to feature test my laravel application in CI. I however cannot get my migrations to run:

$ php artisan migrate
   Illuminate\Database\QueryException 
  could not find driver (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')
  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
    708▕         // If an exception occurs when attempting to run a query, we'll format the error
    709▕         // message to include the bindings with SQL, which will make this exception a
    710▕         // lot more helpful to the developer instead of just the database's errors.
    711▕         catch (Exception $e) {
  ➜ 712▕             throw new QueryException(
    713▕                 $query, $this->prepareBindings($bindings), $e
    714▕             );
    715▕         }
    716▕     }
      +33 vendor frames 

In my CI I add the necessary drivers:

apk add php8-mysqli php8-pdo_mysql

Yet I still get the error.

I've tried to install php-mysql:

apk add php-mysql

But that gives the error:

ERROR: unable to select packages:
  php-mysql (no such package):
    required by: world[php-mysql]

Yet the package does exist: https://pkgs.alpinelinux.org/package/v3.3/main/x86/php-mysql

How do I fix this?

0 Answers
Related