Skip to content
Advertisement

Impossible to load pdo driver on Windows Server 2016

Im trying to load the pdo driver for firebird database on a windows server 2016 (64 bits).

Configuration is the next :

  • Firebird in 32 bits successfully installed.
  • Apache 2.4 successfully installed (Apachelounge binary, 32 bits).
  • Apache configuration properly set (installed in C:/Apache24)
  • PHP 32 bits successfully installed (in C:/PHP) as a module with mod_php (apache handler 2.0).

As a proof : phpinfo result

I can execute the PHP file. Now I want to install the PDO driver in order to have an easy way to connect to the firebird database.

I followed the procedure found on internet (uncomment extension=php_pdo_firebird.dll in php.in and add fb.client.dll in C/apache24/bin and c/php) and checked if the PDO were correctly installed with this command :

php -m|findstr -i pdo_

Which shows me : PDO_Firebird

But when I call the phpinfo function in a test.php file, it does not show me that any PDO driver has been load. It says :

PDO drivers : no values.

which is strange because for PHP the driver is there. So after some research on internet I tried the following things which didn’t work :

  • Adding C/PHP and C:/Apche24/bin in path
  • Copy fbclient.dll in C:/Apache/bin, C:/PHP and even in C:/PHP/ext
  • In php.ini uncomment the line "extension_dir = "ext""
  • For the same line changing value of "ext" to "C:/PHP/ext"
  • Restarting the server after all that

When trying to connect to the firedbird database with a php file I get the error :

Fatal error: Uncaught PDOException: could not find driver in C:Apache24htdocstest3.php:10 Stack trace: #0 C:Apache24htdocstest3.php(10): PDO->__construct(‘firebird:dbname…’, ‘SYSDBA’, ‘masterkey’, Array) #1 {main} thrown in C:Apache24htdocstest3.php on line 10

Of course I could not use PDO driver and use FB/IB extension but I don’t want to.

Any help or advice are welcome.

For the fb.client.dll it was just a misspelling, actually the file name is fbclient.dll.

For the php_interbase.dll, I got it in the php/ext folder. I Also tried to add extension=php_interbase.dll in php.ini file, now when I type in cmd : php -m|findstr -i pdo_ I got the next things : – PDO – PDO_Firebird

But still with the phpinfo() function I get the “no value” for PDO drivers even after restarting Apache.

php –ini show this : Configuration File (php.ini) Path: C:Windows Loaded Configuration File: C:PHPphp.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none)

And the path of the php.ini I edited is C:PHPphp.ini

Advertisement

Answer

Solved ! Guys are going to laugh at me. I was looking for problem everywhere but in fact the problem was so simple that I couldn’t see it. In httpd.conf, when adding PHPIniDir “c:/php” at the end of the file, I actually added PHPIniDir “c/php”. What a shame ! But finally catched it. Thank you for your help.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement