php artisan migrate throwing [PDO Exception] Could not find driver - Using Laravel

php artisan migrate could not find driver windows
pdoexception::("could not find driver") laravel
pdo exception could not find driver laravel mysql
php artisan migrate could not find driver sqlite
pdoexception: could not find driver windows
laravel migrate could not find driver postgres
in pdoconnection.php line 31: could not find driver
pdoexception could not find driver postgres laravel

I have a bad experience while installing laravel. However, I was able to do so and move to the next level. I used generators and created my migrations. But when I type the last command

php artisan migrate

It's throwing a PDOException - could not find driver.

       'mysql' => array(
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'unix_socket'   => '/Applications/MAMP/tmp/mysql/mysql.sock',
            'database'  => 'database',
            'username'  => 'root',
            'password'  => '',
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
        ),

That's my configuration in config/database.php.

I tried searching on stackoverflow and laravel forums and people suggest that it's PDO problem and not artisan's or php's - I followed those suggestions like adding

extension=pgsql.so
extension=pdo_pgsql.so

in php.ini

No positive result. It always says [PDOException]could not find driver.

Can someone please help resolving this.

Environment that I am using: Mac, laravel 4, MAMP PRO with php 5.4.4

You can use

sudo apt-get install php7-mysql

or

sudo apt-get install php5-mysql

or

sudo apt-get install php-mysql

This worked for me.

mysql, You can use sudo apt-get install php7-mysql. or sudo apt-get install php5-mysql. or sudo apt-get install php-mysql. This worked for me. I tried searching on stackoverflow and laravel forums and people suggest that it's PDO problem and not artisan's or php's - I followed those suggestions like adding . extension=pgsql.so extension=pdo_pgsql.so in php.ini . No positive result. It always says [PDOException]could not find driver. Can someone please help resolving this.

This worked for me:

sudo apt-get install php5-sqlite

This installed sqlite for php5, then I ran the php artisan migrate command again and worked perfectly.

php artisan migrate : PDOException could not find driver, Php 5.6 and postgres are running fine with my Projects using PostgreSQL. Now there is some problem with Laravel projects using mysql . On  I have a bad experience while installing laravel. However, I was able to do so and move to the next level. I used generators and created my migrations. But when I type the last command php artisan

You need to specifically enable the pdo_mysql plugin. Assuming you're using a standard PHP installation, then generally you would simply need to add this to your PHP.ini file:

extension=pdo_mysql.so

You need to ensure that this file exists in the extension directory though.

Adding pdo_pgsql.so doesn't help because that is for PostgreSQL.

Additionally, you should ensure that you restart the web-server after you make the changes to the PHP ini file, as the changes may not be reflected otherwise.

Laravel: PDOException: could not find driver, php artisan migrate throwing [PDO Exception] Could not find driver – Using Laravel. Posted by: admin October 29, 2017 Leave a comment. Questions: I have a  Questions: I have a bad experience while installing laravel. However, I was able to do so and move to the next level. I used generators and created my migrations. But when I type the last command php artisan migrate It’s throwing a PDOException – could not find driver. 'mysql' => array( 'driver' => 'mysql', 'host'

Ran into the same issue here, and turns out this is because PHP at the command line uses a different php.ini file from the browser version, which is why it looks like it's loading the extension correctly when you look at phpinfo() in a browser.

As per this answer, you just need to run:

php --ini

At the command line, which will tell you the path to the currently loaded php.ini (probably actually a php-cli.ini file located in the same place as your regular php.ini file).

Once you've found that, modify it with the pdo extensions you want (in this case for MySQL):

extension=pdo_mysql.so

Or, for any other users that are on Windows using some kind of WAMP server, it probably looks like this instead:

extension=php_pdo_mysql.dll

mysql php artisan migrate throwing [PDO Exception] Could not find , php artisan migrate throwing [PDO Exception] Could not find driver - Using Laravel. I have a bad experience while installing laravel. However, I was able to do  Questions: I have a bad experience while installing laravel. However, I was able to do so and move to the next level. I used generators and created my migrations. But when I type the last command php artisan migrate It’s throwing a PDOException – could not find driver. 'mysql' => array( 'driver' => 'mysql', 'host'

I think you missed the mysql driver for php5. Execute below command:

sudo apt-get install php5-mysql
/etc/init.d/php5-fpm restart

PDOException::("could not find driver"), php artisan migrate:refresh --seed [Illuminate\Database\QueryException] could not find driver (SQL: select * from sqlite_master where type = 'table ' and name  I am trying to install Laravel. I have installed Xampp, but when I try to setup my database using php artisan migrateI get the error: [Illuminate\\Database\\QueryException] could not find driver

Could Not Find Driver Laravel, mysql php artisan migrate throwing [PDO Exception] Could not find driver Using Laravel? extension=pdo_mysql.so extension=php_pdo_mysql.dll php --ini. So, this is why Drupal or any other php engine couldn't find the library and shows that error: PDOException: could not find driver I just don't know why it is installed on such a weird path, for me it's just a bug in the library package installation script in debian 6.

could not find driver laravel sqlite, I've followed this steps but when I run: php artisan PDOException::("could not find driver") - Dockerless install and config #1 php artisan migrate --database=​system 663| catch (Exception $e) { > 664| throw new QueryException( 665| /​var/www/multi-tenancy-voyager/vendor/laravel/framework/src/  To create a migration, use the make:migration Artisan command: php artisan make:migration create_users_table. The new migration will be placed in your database/migrations directory. Each migration file name contains a timestamp, which allows Laravel to determine the order of the migrations. {tip} Migration stubs may be customized using stub

However, I was able to do so and move to But when I type the last command php artisan migrate It's throwing a PDOException – could not find driver. php artisan migrate is not working, that was the original question btw – diEcho Oct 2 '14 at 8:42 @diEcho Do you have the same error? What you have defined as default connection and which command you tried?

Comments
  • Do you have the pdo_mysql.so extension?
  • Yes I have... sorry pasted only 2 extensions, but I do have extension=imap.so extension=yaz.so extension=mcrypt.so extension=gettext.so extension=pgsql.so extension=pdo_pgsql.so extension=pdo_mysql.so
  • And are you sure that the module is enabled? In LAMP a module can be enabled using sudo a2enmod <module>. Look at your phpinfo() if the driver is enabled.
  • on phpinfo() - it shows that PDO drivers for sqlite, pgsql, mysql are enabled!
  • As you are using the CLI try running php -i | less and looking to see if the PDO extension is actually being loaded. If not then you will need to amend your php.ini file that is used by the CLI which is not the same one as is used by Apache. It usually lives in the same directory as the PHP exe but thats on windows, not sure where it would be on a mac. but this guy does stackoverflow.com/questions/2750580/…
  • sudo apt-get install php-mysql This worked for me. Thanks mate
  • If you're not sure which, check your PHP version with php --version and install the corresponding driver.
  • Fixed my issue while trying to run phpunit on the main Laravel Framework.
  • I don't understand why, but installing php5-sqlite caused PDO mysql to work correctly. Thanks!
  • Recent versions of Ubuntu do not contain this package. For 16.04, run: sudo apt-get install php-sqlite3
  • How can I check if that file exists in extension directory?
  • Generally your extension directory would be where you installed PHP under in ./ext, for example on Windows it's C:\Program Files (x86)\PHP\ext by default using PHP's installer package.