PHP - How to install PDO driver? (Windows)

I am setting up PHP and MySQL (Maria DB) on Windows 8.1. I edited the php.ini file and uncommented the following lines:

extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_pdo_mysql.dll

But unfortunately, I can’t connect to the database, because there are no pdo drivers in the output of phpinfo. Therefore, when I try to establish a connection to the database, an exception is thrown:

Fatal error: Uncaught exception 'PDOException' with message 'could not find driver'

How to solve this problem?

+4
source share
2 answers

Finally, I managed to solve this problem. I fixed the extension_dir entry (an absolute file path was needed) in the php.ini file, and the database connection started to work.

+4
source

extension_dir apache, 2 php apache, wamp\bin\apache\Apache2.4.23\bin\php.ini, ext

0

All Articles