PDOException: could not find driver when using phpunit PDOException: could not find driver when using phpunit laravel laravel

PDOException: could not find driver when using phpunit


It seems Laravel using SQLite as database for testing. See the backtrace at line 2:

/var/www/smlsspd/vendor/laravel/framework/src/Illuminate/Database/Connectors/SQLiteConnector.php:22

But this seems not installed on your system. So I think you need to install the SQLite driver.


If you are using sqlite for testing you will need php sqlite drivers

For Ubuntu 14.04

sudo apt-get install php5-sqlitesudo service apache2 restart

In ubuntu 16.04 there is no php5-sqlite

sudo apt-get install php7.0-sqlitesudo service apache2 restart


If you are occupying SqLite you have to enter php.init and uncomment this line.

;extension = pdo_sqlite