I know this is a very common question around here, but I'm struggling with a strange problem. PS: I'm rather a newbie to php.
Basically, I want to connect my php code with a Postgres database using PDO, but i keep getting the "could not find driver" exception. Here are some things I tried:
I enabled the drivers in php.ini by uncommenting the proper lines
Then I checked the folder with the .dll driver files - they're okay (i think)
I tried to declare the drivers in php.ini by the following:
extension=pdo_pgsql and extension=pgsql as they're by default like that
extension=php_pdo_pgsql and extension=php_pgsql as they're the names of the .dll files
extension=php_pdo_pgsql.dll and extension=php_pgsql.dll as they're the literal names of the drivers
And so on...
Also i tried to put the relative and absolute path to the files and didn't work as well.
And i also tried uncommenting other extensions like pdo_sqlite and pdo_firebird but they didn't work. The only driver that really appears as enabled on phpinfo() is the extension=pdo_mysql
I'm using PHP8 and Apache 2.4 on Windows 10. I installed and configured both manually, without lamps. I'm asking this because the other topics about the "could not find driver" exception didn't help me. Anyway, has anyone encountered this problem before too? And how did you solved it?
Thanks for your time and please excuse my bad english.
source https://stackoverflow.com/questions/71103385/pdo-with-postgressql-could-not-find-driver-even-with-the-right-php-ini-lines-u
No comments:
Post a Comment