Reputation: 144
I'm trying to move over to PHP7 and use the latest EasyPHP but I can't for the life of me figure out how to connect to MySQL using the PDO
I've set up a working directory: C:\Program Files (x86)\EasyPHP-Devserver-16.1\eds-www\TechMexv3 with cURL
I've installed all my database tables in phpMyAdmin which has worked fine
I'm now trying to connect with the following:
$DBH = new PDOEx('mysql:host=localhost; dbname=techsmex; charset=utf8mb4', 'root', '');
And I'm getting the error: could not find driver
Do I need to install a driver from somewhere that doesn't come with EasyPHP?
Upvotes: 2
Views: 6539
Reputation: 61
In EasyPHP Devserver 16.1.1, the default configuration file for php (php.ini) has the PDO MySQL extension disabled by default.
You have to enable it and restart your server before you can connect to your database.
In order to do this,
In it, is your php.ini file. Open the file with your preferred text editor, and search for ;extension=php_pdo_mysql.dll
Simply remove the semicolon in the beginning so the extension gets activated upon restarting of the HTTP server. Go to your dashboard's main page, and restart the HTTP server.
Upvotes: 3