What issue or error are you experiencing?
When I connect to a new site in WP local, I cannot PHP PDO to work. Every time I try to use PDO, I get back “driver could not be found”. I’m using code that I pulled straight from my live site, where it works perfectly.
I pulled phpinfo() and found the php.ini file that this configuration was using, and then located that - I ensured that there were no semicolons before any of my extension names. I saved, and then restarted Local entirely. I looked into the extensions directory that I found in my version of php.ini and found all of the PDO DLL’s in the php extensions directory as well.
What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc
PHP version 8.2.27
MySQL version 8.0.35
All I’ve done is spun up a new Local WP site and placed existing code from my live site into the public folder. Then ensured that extensions were being activated in my php.ini. and confirmed that the DLLs existed within the PHP extensions directory.
System Details
-
Local Version: Version 9.2.5+6810
-
Operating System (OS) and OS version: Windows 10
Local Logs
Unfortunately I read through my local logs and it’s all from my other local sites, I can’t find anything logging information about this error here.
Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.