Artisan: Could not find driver

I am using Laravel latest version: 3.2.1.

When I run this on the terminal:

php artisan migration:install

I have this error:

could not find driver

I did some searches on Google and the Laravel forum, nothing.

EDIT

I activated the extension, and this is what I have in phpinfo() --with-iconv' '--with-pdo-mysql=mysqlnd' '--with-pdo-pgsql=/opt/lampp/postgresql' '--with-pdo Looks like my pdo is installed.

Here is a picture of my phpinfo()

enter image description here

EDIT 2 I did 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 fine

+5
source share
4 answers

The problem is that my computer had a different version of PHP, and I did not use XAMPP PHP, sugin XAMPP PHP solved the problem.

+5
source

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

 sudo apt-get install php5-mysql 

And then it worked.

+14
source

This is not a Laravel error, this is a PDO problem. Most likely your php.ini file does not load the extension you need for which database driver you are using.

+4
source

probably because you did not install the mysql extension

 sudo apt-get install php-mysql 
0
source

Source: https://habr.com/ru/post/1415842/


All Articles