How do I install PDO drivers for PHP on Windows? How do I install PDO drivers for PHP on Windows? windows windows

How do I install PDO drivers for PHP on Windows?


The problem was the extension_dir directive did not work as a relative path. Changing from extension_dir="ext" to extension_dir="c:/phpinstall_path/ext" fixed the problem.


In my apache httpd.conf I have (note I have # as remmed out because it took me 1 hour at least). So I left it to show me how not to do it.

#PHPIniDir 'c:\apps\php\'#PHPIniDir "C:\Apache24\~PHP_download\php-5.6.11-Win32-VC11-x64\"PHPIniDir "C:/Apache24/~PHP_download/php-5.6.11-Win32-VC11-x64"#LoadModule php5_module "c:/apps/php/php5apache2_2.dll"LoadModule php5_module "C:/Apache24/~PHP_download/php-5.6.11-Win32-VC11-x64/php5apache2_4.dll"AddHandler application/x-httpd-php .php

In the above folder (and seen below) I have these files:

 Directory of C:\Apache24\~PHP_download\php-5.6.11-Win32-VC11-x6407/24/2015  12:33 PM    <DIR>          .07/24/2015  12:33 PM    <DIR>          ..07/24/2015  12:32 PM            69,632 deplister.exe07/24/2015  12:32 PM    <DIR>          dev07/24/2015  12:32 PM    <DIR>          ext07/24/2015  12:32 PM    <DIR>          extras07/24/2015  12:32 PM         1,290,752 glib-2.dll07/24/2015  12:32 PM            16,384 gmodule-2.dll07/24/2015  12:32 PM        25,337,856 icudt54.dll07/24/2015  12:32 PM         1,907,712 icuin54.dll07/24/2015  12:32 PM            51,200 icuio54.dll07/24/2015  12:32 PM           256,000 icule54.dll07/24/2015  12:32 PM            50,176 iculx54.dll07/24/2015  12:32 PM            63,488 icutest54.dll07/24/2015  12:32 PM           195,072 icutu54.dll07/24/2015  12:32 PM         1,369,088 icuuc54.dll07/24/2015  12:32 PM            79,826 install.txt07/24/2015  12:32 PM    <DIR>          lib07/24/2015  12:32 PM         1,823,232 libeay32.dll07/24/2015  12:32 PM            46,592 libenchant.dll07/24/2015  12:32 PM           160,256 libpq.dll07/24/2015  12:32 PM           237,056 libsasl.dll07/24/2015  12:32 PM           201,728 libssh2.dll07/24/2015  12:32 PM             3,286 license.txt07/24/2015  12:32 PM           518,643 news.txt07/24/2015  12:32 PM                43 phar.phar.bat07/24/2015  12:32 PM            53,242 pharcommand.phar07/24/2015  12:32 PM            58,368 php-cgi.exe07/24/2015  12:32 PM            30,720 php-win.exe07/24/2015  12:32 PM            77,824 php.exe07/24/2015  12:32 PM             2,523 php.gif08/29/2015  02:28 PM            74,572 php.ini07/24/2015  12:32 PM            74,334 php.ini-development07/24/2015  12:32 PM            74,365 php.ini-production07/24/2015  12:32 PM            31,744 php5apache2_4.dll07/24/2015  12:32 PM           845,830 php5embed.lib07/24/2015  12:32 PM           167,936 php5phpdbg.dll07/24/2015  12:32 PM         8,269,312 php5ts.dll07/24/2015  12:32 PM           180,224 phpdbg.exe07/24/2015  12:32 PM            21,360 readme-redist-bins.txt07/24/2015  12:32 PM             3,634 snapshot.txt07/24/2015  12:32 PM           353,280 ssleay32.dll

And in that same folder, in the php.ini file I have the following block that are pdo-related, with the ones in force not remmed out with a ;

;extension=php_pdo_firebird.dllextension=php_pdo_mysql.dll;extension=php_pdo_oci.dllextension=php_pdo_odbc.dll;extension=php_pdo_pgsql.dll;extension=php_pdo_sqlite.dll

then I have a phpinfo_xyz.php file for testing purposes only (read: delete it when you are done) that contains

<?php phpinfo(); ?>

Restart apache, point to that file from a browser and notice the following blocks similar to the following three.

enter image description here

...

enter image description here

...

enter image description here

In the first PHP picture above from phpinfo(), it was the getting the path right in httpd.conf that took the longest. That is why I left in the wrong path attempts seen in this Answer.

So it wasn't until Loaded Configuration File showed up decent that it had a chance.

Good luck. It was not fun. Half the problem was there were like 2 or 4 options of which original download to perform. Sadly I think it took me 2 or 3 hours all together. But I am not as smart as the rest of you.