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

morad7's avatar

Laravel 5.1 : Class 'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found

Trying to follow "laravel 5 fundamental serie", I'm using laravel 5.1 , I'm trying to do a migrate:refresh, I get an error :

Class 'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found in ../vendor/laravel/framework/src/Illuminate/Database/SQLiteConnection.php [Symfony\Component\Debug\Exception\FatalErrorException] Class 'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found Doctrine/dbal is already required in my composer.json

"require": { "php": ">=5.5.9", "laravel/framework": "5.1.*", "Doctrine/dbal": "^2.5" } So I want to ask what is wrong in my laravel project.

0 likes
22 replies
bobbybouwmann's avatar

Did you do a composer install? You need to download the package first before you can use it. Also the name of the package should be in lower case

"doctrine/dbal": "^2.5"
3 likes
morad7's avatar

@bobbybouwmann , I just did "composer require Doctrine/dbal" and "composer update", should I do "composer doctrine/dbal install"?

bobbybouwmann's avatar

It should be composer require doctrine/dbal, but I think it's ok then! Are you still getting the same error?

1 like
morad7's avatar

@bobbybouwmann, yes I still getting the same error, I did a "composer install" and I updated my composer.json making the package in lower case and "composer update".

ohffs's avatar

Oddly enough - I get the same error using sqlite and migrate:refresh - plain migrate works ok. @morad7 if you delete your database file and touch a new one - can you run plain artisan migrate ok?

ohffs's avatar

@bobbybouwmann I've tried ubuntu 15.04 and a CentOS 5.6 box - both can run migrate ok so the base pdo sqlite itself seems fine, just the doctrine dbal things seems unhappy. I only noticed as I was trying to be cheap and see if I could get away with using sqlite rather than mysql on a server to save some ram ;-) That'll teach me to try and save ~2 euro a month.. ;-)

bobbybouwmann's avatar

You might need to install it then as well, I believe Homestead has it installed by default

apt-get install php-doctrine-dbal
ohffs's avatar

@bobbybouwmann didn't make any difference sadly. Amusingly my vm now runs out of ram running composer update - I think I'll give up on this and just pay out the extra euro and run with mysql ;-)

morad7's avatar

@ohffs do you mean deleting the database.php or database.sqlite file?

ohffs's avatar

@morad7 the database.sqlite file (or move it somewhere else) then just touch database.sqlite file again to make an empty one. The :refresh will erase all your data anyway so it's like an awkward version of the same thing ;-)

ohffs's avatar

@morad7 ah - unlikely to be ram shortage then ;-) I was trying to squeeze into 512mb ;-)

morad7's avatar

@ohffs wow, after creating an empty database.sqlite file and migrate:refresh

Migration table not found.
Migration table created successfully.
Migrated: 2014_10_12_000000_create_users_table
Migrated: 2014_10_12_100000_create_password_resets_table
Migrated: 2015_09_20_212553_create_articles_table
Migrated: 2015_09_20_213743_add_excerpt_to_articles_table
Migrated: 2015_09_21_223541_create_tasks_table

morad7's avatar

@ohffs at least I can now continue the serie, mybee we will get more explanation about this issue in the future. thank you and @bobbybouwmann

tripper54's avatar

Strangely enough I have the same issue on my local machine (mac , homestead).

php artisan:migrate refresh

fails with Class 'Doctrine\DBAL\Driver\PDOSqlite\Driver' not found. But if I

cat /dev/null > storage/database.sqlite 
php artisan migrate

, it's all good.

codebyjeff's avatar

Whether or not this is related to the issues above, I don't know, but for me it was a dependency issue & simply rerunning composer install set it straight

Please or to participate in this conversation.