Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

laravel-5.1

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.

like image 976
learner123 Avatar asked Oct 07 '15 21:10

learner123


2 Answers

From the official docs:

Before modifying a column, be sure to add the doctrine/dbal dependency to your composer.json file. The Doctrine DBAL library is used to determine the current state of the column and create the SQL queries needed to make the specified adjustments to the column:

composer require doctrine/dbal
like image 71
Nabil Kadimi Avatar answered Sep 28 '22 07:09

Nabil Kadimi


What worked for me is to delete the database.sqlite file and create an empty one.
I know this is not the best solution, but it fixed the issue in my use case.

like image 28
learner123 Avatar answered Sep 28 '22 07:09

learner123