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

Muhammad.shahid.shah's avatar

phpunit sqlite error after updating laragon (PDOException: could not find driver)

php artisan migrate etc works fine.But when i try to use phpunit i am getting the following errors after updating my laragon which updated php too in the process, its now 7.1 , but i also have xampp installed which has php 7.0 and if i remove the php from laragon folder then the tests works with php 7.0 (xampp,s php is in my environment variables) i also tried removing xampp,s php(7.0) path and replaced it with laragons php(7.1) path in environment variables but still same error.

note: it works fine if i just stick to the default php(which is xampp,s php 7.0 in environment variable) and delete php folder in laragon. but i want to make it work, and find the solution of this. and i checked php.ini of laragons php pdo_mysql was enabled.i searched it and tried different ways but no positive result. here is the error sample.

28) Tests\Unit\ThreadTest::it_can_add_replies
Illuminate\Database\QueryException: could not find driver (SQL: select * from sqlite_master where type = 'table' and name = migrations)

C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Connection.php:647
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Connection.php:607
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Connection.php:326
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Schema\Builder.php:72
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Migrations\DatabaseMigrationRepository.php:154
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php:544
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Console\Migrations\MigrateCommand.php:96
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Database\Console\Migrations\MigrateCommand.php:62
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:87
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:31
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Container\Container.php:539
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Console\Command.php:182
C:\laragon\www\practice\vendor\symfony\console\Command\Command.php:252
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Console\Command.php:167
C:\laragon\www\practice\vendor\symfony\console\Application.php:938
C:\laragon\www\practice\vendor\symfony\console\Application.php:240
C:\laragon\www\practice\vendor\symfony\console\Application.php:148
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Console\Application.php:141
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php:220
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\InteractsWithConsole.php:18
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Foundation\Testing\DatabaseMigrations.php:16
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Foundation\Testing\TestCase.php:102
C:\laragon\www\practice\vendor\laravel\framework\src\Illuminate\Foundation\Testing\TestCase.php:69
C:\laragon\www\practice\tests\TestCase.php:15
C:\laragon\www\practice\tests\Unit\ThreadTest.php:14
C:\Users\shahid\project\vendor\phpunit\phpunit\src\TextUI\Command.php:188
C:\Users\shahid\project\vendor\phpunit\phpunit\src\TextUI\Command.php:118

Caused by
PDOException: could not find driver
0 likes
3 replies
emdidar's avatar

Just go to php.ini file search for extension=pdo_sqlite and replace ;extension=pdo_sqlite to extension=pdo_sqlite

1 like

Please or to participate in this conversation.