Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel: Error [PDOException]: Could not Find Driver in PostgreSQL?

I am trying to connect PostgreSQL with Laravel 5.0 but facing exception "Could not Find Driver in PostgreSQL".

I have tried this solution but cannot connected with PostgreSQL

stackoverflow answer

My database.php config file is following

'default' => 'pgsql'

            'pgsql' => [
                'driver'   => 'pgsql',
                'host'     => env('DB_HOST', 'localhost'),
                'database' => env('DB_DATABASE', 'forge'),
                'username' => env('DB_USERNAME', 'forgeUser'),
                'password' => env('DB_PASSWORD', '****'),
                'charset'  => 'utf8',
                 'prefix'   => '',
                'schema'   => 'public',
                'port'     => 5432,
            ]

PDO extensions are enabled in php.ini

extension=php_pdo.dll

extension=php_pdo_pgsql.dll

when i run following command

php artisan migrate

it gives error

[PDOException] could not find driver

Its working fine when we connect PostgreSQL with Core PHP.

is there any driver still missing in Laravel? Please guide me.

Thank You

like image 315
yousafHarry Avatar asked Mar 12 '15 16:03

yousafHarry


1 Answers

You must be ssh'd into your homestead or vagrant box. Then try to migrate.

like image 154
lukeed Avatar answered Nov 15 '22 00:11

lukeed