Artisan: Could not find driver

user745235 picture user745235 · Jun 3, 2012 · Viewed 8.5k times · Source

I'm using Laravel last version: 3.2.1.

When I run this on terminal:

php artisan migration:install

I have this error:

could not find driver

I made some searches on Google and on Laravel's Forum, nothing.

EDIT

I have activated the extension and this is what I have on phpinfo() --with-iconv' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql' '--with-pdo It looks like my pdo is set.

Here is an image of my phpinfo()

enter image description here

EDIT 2 I've made a little test:

<?php
try {
    $dbh = new PDO("mysql:host=localhost;dbname=jjimobiliaria", "root", "");
    foreach($dbh->query('SELECT * from pdo_test') as $row) {
        print_r($row);
    }
    $dbh = null;
} catch (PDOException $e) {
    print "Error!: " . $e->getMessage() . "<br/>";
    die();
}

And the return:

Array ( [id] => 1 [0] => 1 [test_column] => TESTING!!! [1] => TESTING!!! )

So my PDO is working perfectly

Answer

Branimir Kolar picture Branimir Kolar · Sep 23, 2012

On Ubuntu 12.04 all I had to do was to install php5-mysql:

sudo apt-get install php5-mysql

And then it worked.