QueryException Laravel : Driver not found - php

I am facing a strange error with laravel under ubuntu using PostgreSql.
Its NOT a PDOException. The database migration is successful so all driver are set and PDO connection is also established. But why this error?
Didn't find much about it in google. I am attaching the screenshot.
This is NOT homestead rather own lamp stack.
Edit:
There is no problem even with tinker
Regards

I resolved this issue using the following command:-
sudo apt install php7.4-pgsql (replace 7.4 with your php version)
To check PHP version use: php -v
For more info visit: https://www.php.net/manual/en/pgsql.installation.php
Please check php info and serach "PDO Driver for PostgreSQL" or "pdo_pgsql" after run the above command
keywords :- for pgadmin, pgsql, postgresql, PDO Driver for PostgreSQL, pdo_pgsql #vasimraja

Please check the default key in app/config/database.php
For postgres, default should be 'default' => 'postgres',

Related

After installing mssql driver, I get driver not found exception in php (MAC OS 10.11.3)

My php version is 7.1. I installed mssql driver and other sqlsrv,pdo_sqlsrv drivers. But when I try this,
#php artisan migrate
I get following exception
[Illuminate\Database\QueryException]
could not find driver (SQL: select * from sysobjects where type = 'U' and n
ame = migrations)
[PDOException]
could not find driver
I was having the same problem,
I found out that the cli was using php7.1 but I did follow the MS Guide for installing the SqlServer driver for php 7.0.
For some reason, php was using 7.0 and the cli was using 7.1.
So my routes were working (when querying sql server), but the php artisan migrate gave that error.
For my specific case, I resolved by removing php 7.1, leaving only the 7.0 for php and php-cli.
apt-get purge php7.1-common
This answer pointed me in the right direction
Laravel SQL Server - PDOException could not find driver on migrate
Good luck :)

Oracle PDO for PHP5.4 on CentOS7

I am trying to set up a driver for Oracle on a PHP script on CentOS7 with Apache.
I have followed the steps at:
And OCI does show up in phpinfo(), but whenever I try to use the driver, it throws a PDOException that it can't find the driver.
Please help.
Thank you.

Laravel 5.1/Homestead PDOException

I am learning Laravel and migrations. I have installed Homestead successfully and everything is be up and running — MySQL included — until I give my first
php artisan migrate
and the shell outputs
[PDOException]
could not find driver
so I connect to the virtual machine via SSH and try to install the PHP extensions required to work with the database, but apt-get detects I have the latest driver version already installed. Then I check to see if PDO is working, so I type php -i | grep PDO and everything looks good:
PDO
PDO support => enabled
PDO drivers => mysql, pgsql, sqlite
PDO Driver for MySQL => enabled
PDO Driver for PostgreSQL => enabled
PDO Driver for SQLite 3.x => enabled
I am out of ideas, what could possibly go wrong?

Symfony and PostgreSQL — this error is driving me crazy

I have installed php 5.6.13, nginx, postgresql (using brew, on Mac OS)
I found in log:
PDOException: could not find driver at /project-folder//vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
and thought what this is simple mistake in parameters.yml, but everything is OK in parameters and config.
Command doctrine:schema:create and doctrine:fixtures:load working fine with same settings!
So I checked php:
>> php -m
PDO
pdo_dblib
PDO_ODBC
pdo_pgsql
pdo_sqlite
try clear cache: console cache:clear
remove and set up cache, logs folders with http://symfony.com/doc/current/book/installation.html
But I can not login on the site and everytime have save error PDOException: could not find driver
I have no idea — how it can loading fixtures, but can not find PDO driver, when I try to login on the site.
I tried many time remove and install php56, php56-pdo-pgsql, nginx... Any idea...
UPDATE
Problem solved after restart Mac OS.

Could not find driver for Laravel [Cent OS 6]

I tried sudo yum install php54w-pdo --enablerepo=remi to install PDO driver in centos 6.
It installed successfully. But exception is raised by laravel
PDOException in Connector.php line 47: could not find driver
Did everything i can. Tried different solution from stackoverflow. but didn't work.
You may also need to install pdo driver for the database you are using. php-pdo alone is not sufficient as it is mostly abstraction layer and to be able to connect to particular database it yet needs a right driver (i.e. php54w-mysqlnd which would provide pdo-mysql driver).

Categories