After enabling those you might need to restart the webserver or restart your computer
Use php -m to see if they are loaded
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm having some troubles trying to connect to a postgres database of an already existing laravel project done with mysql.
for the moment, I have this in my .env file:
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_SCHEMA=torrecontrol
DB_DATABASE=torrecontrol
DB_USERNAME=postgres
DB_PASSWORD=1234
and updated the file database.php
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => env('DB_SCHEMA', 'public'),
'sslmode' => 'prefer',
],
And I'm using those parameters to connect to postgres with a DBeaver (a database client).
but when I run the command: php artisan migrate, it gives me this error:
could not find driver (SQL: select * from information_schema.tables where table_schema = torrecontrol and table_name =
migrations and table_type = 'BASE TABLE')
I also updated the php.ini file to allow the pgsql extensions:
extension=pdo_pgsql
extension=pgsql
and of course I also cleared the cache with php artisan optimize and php artisan config:clear
what else could I be missing so I can migrate this?
@dru Any chance you have two php.ini files? One for apache and one for cli?
Please or to participate in this conversation.