Skip to content
Advertisement

Firebird driver not found in PHP or XAMPP

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).

Advertisement

Answer

There are few rules but very important:

  1. Check your PHP architecture (32 or 64 bits)
  2. 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).
  3. Knowing DB version and PHP architecture, choose the right version (32 o 64) from Firebird downloads.
  4. Install DB server (you can install a 32 bit server on 64 bit SO/PHP, no problem with that at this point).
  5. 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.

  1. In php.ini uncomment firebird pdo extension (extension=pdo_firebird).

  2. 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)FirebirdFirebird_2_0bin) 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.

  3. If you are using XAMPP, add the same dll to folder C:xamppapachebin to avoid getting this error

    PHP Warning: PHP Startup: Unable to load dynamic library ‘pdo_firebird’ (tried: C:xamppphpextpdo_firebird (The specified module could not be found.), C:xamppphpextphp_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.

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