1
votes

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:\Apache24\htdocs\test3.php:10 Stack trace: #0 C:\Apache24\htdocs\test3.php(10): PDO->__construct('firebird:dbname...', 'SYSDBA', 'masterkey', Array) #1 {main} thrown in C:\Apache24\htdocs\test3.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:\PHP\php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none)

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

2
Did you add fbclient.dll, or is it really called fb.client.dll (which is wrong)? Also do you have the php_interbase.dll? - Mark Rotteveel
What is the path of the php.ini you edited? And what does php --ini show? - vstm
can you try running the pgp-cgi.exe file in your php folder to see if it will show you any errors? It is usually the easiest way to see if your drivers (.dll) are missing and / or if they have an incorrect path set - Igor Ilic
I edited the initial post to answer you. For the php-cgi.exe when I run it it just doesn't show anything - needHelp
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. How to mark this as "Solved" ? - needHelp

2 Answers

0
votes

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.

0
votes

In my case the reason was a little more complex.

Given:

  1. Windows10-64/Apache24-64/PHP8-64.
  2. php -r "$s=new PDO(dsn, user, pass)" works well without errors. The same expression on page throws an exception "driver not found".
  3. php -i lists a PDO Firebird driver and the version of the dll. phpinfo() on page shows no PDO drivers at all.

The solution is to copy fbclient.dll (64-bit of course) not only in PHP directory but in Apache/bin too!