1

How to read Firebird 1.5 database with PHP 8 on Linux?

I have uncommented pdo_firebird extension in php.ini and restarted php8.0-fpm, but when checking modules with php -m, I'm getting the following error:

$ php -m                                                                                               
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_firebird' (tried: /usr/lib/php/20200930/pdo_firebird (/usr/lib/php/20200930/pdo_firebird: cannot open shared object file: No such file or directory), /usr/lib/php/20200930/pdo_firebird.so (/usr/lib/php/20200930/pdo_firebird.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

Where can I find a compatible pdo_firebird.so file ? I couldn't find anything on the official website.

DevonDahon
  • 7,460
  • 6
  • 69
  • 114
  • 1
    The Firebird project doesn't provide a PDO library, this is (was?) part of PDO as delivered by the PHP project. However, it looks like you need to explicitly install it. How, depends on the your Linux distribution, or how you compiled PHP (if you did so yourself). – Mark Rotteveel Sep 01 '21 at 17:33
  • In other words: which Linux distribution do you use, and how did you install PHP? – Mark Rotteveel Sep 01 '21 at 17:43
  • @MarkRotteveel I'm using Ubuntu and PHP was installed using `apt`. – DevonDahon Sep 01 '21 at 18:58
  • You also installed Firebird client, didn't you? – user13964273 Sep 01 '21 at 21:45
  • you have first to install Firebird Server and have it running, then you can use PHP PDO to connect to that server. Unless you have a running Firebird Server there is nothing PDO driver can connect to! To read FDB files from 32-bit FB 1.5 you can install Firebird 1.5 to 2.5 versions (personally i would go with 2.5) but not 3.0 and above. There were complexities with Firebird 1.5 64-bit, but since those were almost experimental back then the chances are low. – Arioch 'The Sep 01 '21 at 23:15
  • Does `/usr/lib/php/20200930/pdo_firebird.so` actually exist? If it exists, I think Arioch 'The is right, and the thing you're missing is libfbclient.so. In that case you need to install for example `firebird3.0-common` or `libfbclient2` using apt (any version of the Firebird client library should be able to connect to a Firebird 1.5 server). – Mark Rotteveel Sep 02 '21 at 06:33
  • I have a remote firebird 1.5 database which I would like to access from Laravel framework on Ubuntu Linux an macos. So, I installed `harrygulliford/laravel-firebird`, but since `php -m` says it can't find `pdo_firebird.so`, there's nothing I can do with it. @MarkRotteveel `/usr/lib/php/20200930/pdo_firebird.so` doesn't exist. – DevonDahon Sep 02 '21 at 07:58
  • @DevonDahon speaking from common sense of Windows and DLLs, when a "DLL can not be loaded" kind of error is met it does not mean that it was THAT top-level DLL failing immediately, there is a "dependency tree" of DLL's requiring other DLLs and those require other DLLs and so forth. So even if `pdo_firebird.so` would exists it does not mean it would be able to load without arch-matching lbfbclient SO – Arioch 'The Sep 02 '21 at 09:51
  • Also https://packages.ubuntu.com/en/groovy-updates/php7.4-pdo-firebird and https://www.dmosk.ru/miniinstruktions.php?mini=firebird-php – Arioch 'The Sep 02 '21 at 09:52
  • Have you tried installing `php-pdo-firebird`? I don't have an Ubuntu install at hand right now, so I can't verify, but that seems to be the package that provides it. – Mark Rotteveel Sep 02 '21 at 11:36
  • Also consider asking your question on https://groups.google.com/g/firebird-php – Mark Rotteveel Sep 02 '21 at 12:41
  • I fixed the issue on Ubuntu Linux by installing `php-interbase` package and recommenting `;extension=pdo_firebird` in the two PHP `ini` files (`cli` and `fpm`). But on macos, I'm always getting `Illuminate\Database\QueryException with message 'could not find driver` when trying to make a request to the database from Laravel tool `php artisan tinker`. And `brew` doesn't offer php-interbase package. Any idea ? – DevonDahon Sep 03 '21 at 09:20
  • did you look into the list of brew packages containing either firebird or interbase in their names ? Anyway, MacOS is not Linux and hardly is subject of this question – Arioch 'The Sep 03 '21 at 15:41
  • did you try this https://stackoverflow.com/questions/tagged/macos+firebird ? i see at very least https://stackoverflow.com/questions/67614393 and https://stackoverflow.com/questions/53794894 – Arioch 'The Sep 03 '21 at 15:42

0 Answers0