I have a Laravel 5.8, running locally on my macOS Big Sur 11.4
Loaded Configuration File
/Applications/MAMP/bin/php/php7.4.12/conf/php.ini.
pdo_pgsql
I checked /Applications/MAMP/bin/php/php7.4.12/conf/php.ini.
I found these, they are uncommented already.
It's also reflected in the phpinfo page
Lately, I can not run php artisan migrate
successfully, I kept getting :
Illuminate\Database\QueryException : could not find driver (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')
I'm using psql
not MySQL.
DB_LOCAL_CONNECTION=pgsql
DB_LOCAL_HOST=localhost
DB_LOCAL_PORT=5432
DB_LOCAL_DATABASE=dbName
DB_LOCAL_USERNAME=postgres
DB_LOCAL_PASSWORD=
Did I check the wrong file? What else should I check ?
@Tim : I added this as per your comment.
<?php
return [
'default' => env('DB_LOCAL_CONNECTION', 'pgsql'),
'connections' => [
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_LOCAL_HOST', '127.0.0.1'),
'port' => env('DB_LOCAL_PORT', '5432'),
'database' => env('DB_LOCAL_DATABASE', 'db'),
'username' => env('DB_LOCAL_USERNAME', 'user'),
'password' => env('DB_LOCAL_PASSWORD', '123'),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
]
];
@Brain
This is for you. I tried to update the CLI version to 7.3 like so, and check the ini file of that 7.3, it is enabled ... plz see steps below
brew install php@7.3
cd /usr/local/etc/php/7.3/
code php.ini
➜ 7.3 cat php.ini | grep pgsql
extension=pdo_pgsql
extension=pgsql
; http://php.net/pgsql.allow-persistent
pgsql.allow_persistent = On
; http://php.net/pgsql.auto-reset-persistent
pgsql.auto_reset_persistent = Off
; http://php.net/pgsql.max-persistent
pgsql.max_persistent = -1
; http://php.net/pgsql.max-links
pgsql.max_links = -1
; http://php.net/pgsql.ignore-notice
pgsql.ignore_notice = 0
; Unless pgsql.ignore_notice=0, module cannot log notice message.
; http://php.net/pgsql.log-notice
pgsql.log_notice = 0