untymage's avatar

sqlite: could not find driver On Windows

I want to work with sqlite database while i'm on phpunit but laravel says driver not found:

Windows

php.ini:

extension=pdo_sqlite

phpunit.xml:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
         bootstrap="vendor/autoload.php"
         colors="true">
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory suffix="Test.php">./tests</directory>
        </testsuite>
    </testsuites>
    <coverage processUncoveredFiles="true">
        <include>
            <directory suffix=".php">./app</directory>
        </include>
    </coverage>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
    </php>
</phpunit>

database.php

        'sqlite' => [
            'driver' => 'sqlite',
            'database' => database_path('database.sqlite')),
            'prefix' => '',
            'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
        ],

also file exists at C:\xampp\htdocs\project\database\database.sqlite

error:

could not find driver (SQL: PRAGMA foreign_keys = ON;)#0 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(638)
0 likes
3 replies
untymage's avatar

I'm on windows, Also extension=sqlite3 is enabled in php.ini

Please or to participate in this conversation.