I lost a day trying to connect to a firebird database when I started my first PHP project with it, so I want to share my solutions that maybe can help others in the future (or myself).
2 Answers
There are few rules but very important:
- Check your PHP architecture (32 or 64 bits)
- Check the database version (if you have a file.fdb file to start from) to get the right dll version for your database (or you will not connect to it). This is in spanish, but you can see some useful commands . E.g.: I had a file.fdb from a system with Firebase 2.1 installed. I tried with Firebird 3.0 client dll but couldn't connect, then tried with 2.5 and worked).
- Knowing DB version and PHP architecture, choose the right version (32 o 64) from Firebird downloads.
- Install DB server (you can install a 32 bit server on 64 bit SO/PHP, no problem with that at this point).
- Try to connect to it (you can use an SQL manager like Dbeaver to create a file.fdb and test connection).
Now you know it is working, time to configure PHP.
In php.ini uncomment firebird pdo extension (extension=pdo_firebird).
Get client library: if you installed Firebird server with same architecture than PHP version, you can directly get firebird dll (fbclient.dll) from main firebase folder (e.g.: C:\Program Files (x86)\Firebird\Firebird_2_0\bin) and copy to php folder (e.g.: C:\php). If your Firebird server doesn't match architecture with PHP, then you can get the ZIP package with your PHP arch from firebirdsql.org and simply get the fbclient.dll from it to php folder.
If you are using XAMPP, add the same dll to folder C:\xampp\apache\bin to avoid getting this error
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_firebird' (tried: C:\xampp\php\ext\pdo_firebird (The specified module could not be found.), C:\xampp\php\ext\php_pdo_firebird.dll (The specified module could not be found.))
Now, with phpinfo, you would see, in the PDO drivers section, the firebird PDO driver active.

- 978
- 1
- 14
- 27
-
1You don't need to install the 32-bit Firebird **server** if you're using 32-bit PHP, you will need to install the 32-bit Firebird **client library** (you can use the server installer to install only the client library). – Mark Rotteveel Aug 20 '20 at 12:48
-
You are right, I will edit to reflect this info. I was not completely sure about it, because didn't try (once I have to install Firebird server, I installed same arch as Windows system), but has logic. Thanks. – Eagle Aug 20 '20 at 16:32
I had the same problems, and the only way I could make php load pdo_firebird was to place the fbclient.dll 64 bits and the php_pdo_firebird.dll in the windows\system32. Using xampp 8

- 1
- 2