I had the same problem with some incompatibility (not immediately obvious) between the versions of Apache and PHP that I downloaded. Try writing a toy PHP script that simply creates a new PDO object, something like:
<?php $dbname = 'mydb'; $username = 'myuser'; $password = 'mypassword'; try { $pdo = new \PDO("mysql:host=localhost;dbname=$dbname", $username, $password); } catch (Exception $e) { print $e->getMessage() . "\n"; } print "OK\n";
Then run this script from the command line. If you do not receive the "Could not find driver" error message, this indicates incompatible versions of PHP and Apache.
source share