Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
connecting postgres with laravel

Hello i'm trying to connect laravel 5.4 with postgres, after updating the database configuration file and running php artisan migrate, the following error appears:

[Illuminate\Database\QueryException]
 could not find driver (SQL: select * from information_schema.tables where t
 able_schema = public and table_name = migrations)
[PDOException]
 could not find driver

this is my .env file

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=Portail
DB_USERNAME=php
DB_PASSWORD=php

and this is my database.php file

'default' => env('DB_CONNECTION', 'pgsql'),
 'pgsql' => [
            'driver' => 'pgsql',
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '5432'),
            'database' => env('DB_DATABASE', 'Portail'),
            'username' => env('DB_USERNAME', 'php'),
            'password' => env('DB_PASSWORD', 'php'),
            'charset' => 'utf8',
            'prefix' => '',
            'schema' => 'public',
            'sslmode' => 'prefer', ], 

and i use phpPgAdmin normally

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

sudo apt-get install php-pgsql. This is the command to install php pgsql driver in linux

about 4 years ago · Santiago Trujillo Report

0

I had a similar problem using on Ubuntu18.04 using php7.4 Solution:

  • First check you PHP version with php -v, in my case the version come out to be php7.4 so installed the necessary driver with apt-get install php7.4-pgsql

  • Finally restart the PHP server

about 4 years ago · Santiago Trujillo Report

0

I found the solution there are two php.ini files

  • C:\wamp64\bin\apache\apache2.4.9\bin

  • C:\wamp64\bin\php\php7.0.10

i must do uncommented php_pdo_pgsql.dll and php_pgsql.dll in the two files thanks for your help all

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!