1

I am trying to initialize a database in Laravel. For this I am using the command php artisan db:seed

It returns the error:

"Could not find driver".

As seen in this screenshot

I am using PostgreSQL and my operational system is Windows 10. Any idea of what could be causing this error?

My .env file

APP_NAME=Revieway APP_ENV=local 
APP_KEY=base64:xWdLc4KY3iJKHCupluHuu1nDwvpyk4OAqnsc6RRrGsA=
APP_DEBUG=true 
APP_LOG_LEVEL=debug
APP_URL=localhost:8000
DB_CONNECTION=pgsql 
DB_HOST=192.168.99.100:5050
DB_PORT=5432
DB_DATABASE=postgres 
DB_USERNAME=postgres
DB_PASSWORD=gghmm 
BROADCAST_DRIVER=log 
CACHE_DRIVER=file 
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync
Makdous
  • 1,447
  • 1
  • 12
  • 24
Pedro
  • 11
  • 3
  • Does this answer your question? [Laravel 5 PDOException Could Not Find Driver](https://stackoverflow.com/questions/35240414/laravel-5-pdoexception-could-not-find-driver) – Hirumina May 02 '20 at 16:57
  • What are the values of your `.env` file? How does your seeder look? – vblinden May 02 '20 at 17:03
  • Hirumina, no. Most answers in this post are considering mysql. I have to use postgresql, which I already have installed. – Pedro May 02 '20 at 17:12
  • APP_NAME=Revieway APP_ENV=local APP_KEY=base64:xWdLc4KY3iJKHCupluHuu1nDwvpyk4OAqnsc6RRrGsA= APP_DEBUG=true APP_LOG_LEVEL=debug APP_URL=http://localhost:8000 DB_CONNECTION=pgsql DB_HOST=192.168.99.100:5050 DB_PORT=5432 DB_DATABASE=postgres DB_USERNAME=postgres DB_PASSWORD=gghmm BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file SESSION_LIFETIME=120 QUEUE_DRIVER=sync – Pedro May 02 '20 at 17:17
  • this is my .env file – Pedro May 02 '20 at 17:17
  • Do you have `php` and `postgresql` installed locally or are you using a virtual machine? If so, you should run the command on the VM. – vblinden May 02 '20 at 17:33
  • Your DB_HOST should not contain the port: `:5050` – Ron May 02 '20 at 17:38
  • I have php and postgres installed locally – Pedro May 03 '20 at 10:02
  • I think the DB_HOST is right. I tried removing the port just to be sure, but it doesnt help either. – Pedro May 03 '20 at 10:04

1 Answers1

0

The PosgreSQL extension must be enabled on your php.ini file.

Open it, an change:

;extension=pdo_pgsql

to:

extension=pdo_pgsql
Gus Costa
  • 609
  • 5
  • 13