php-interbase.so won't load

15 views
Skip to first unread message

Paul Vinkenoog

unread,
Oct 10, 2025, 5:03:52 PMOct 10
to Firebird-PHP
Hi all,

I have php-firebird drivers (to be precise: php_8.2.0-interbase-3.0.1-linux-x64.so
and php_8.3.0-interbase-3.0.1-linux-x64.so) running succesfully on several servers
under Almalinux 9.

Now I'm installing it for a new project and I get this error when php-fpm starts:

PHP Warning: PHP Startup: Unable to load dynamic library 'interbase'
(tried: /usr/lib64/php/modules/interbase (/usr/lib64/php/modules/interbase:
cannot open shared object file: No such file or directory),
/usr/lib64/php/modules/interbase.so
(/usr/lib64/php/modules/interbase.so:
undefined symbol: zend_unregister_ini_entries_ex)) in Unknown on line 0

The PHP package is the default from the @appstream repo.
It reports 8.0.30 as its version, but I don't know if that says much,
because AFAIK those packages are often updated without upping the
version number.

Does anyone recognize this and maybe have some advice?

I can't find any linux php-interbase builds for PHP 8.0 or 8.1.

Does someone know where I can find them so I can try them out?

I'm in a bit of a predicament because it has to work on Monday :-(

BTW, the ones that work are with php installations from the remi-safe
repo, which I wanted to avoid this time...

Cheers all, and I hope someone can point me in the right direction!

Paul Vinkenoog

Emil Totev

unread,
Oct 11, 2025, 2:53:33 AMOct 11
to Firebird-PHP
If you are trying to run the extension for PHP 8.2 with PHP 8.0, this will definitely not work. Each PHP version comes with an API/extension version (you can search for it in the `php -i` output). By 'version' I mean 8.0, 8.1 etc, not the minor releases. 
My advice would be to compile the extension yourself for the version you need. The process is described on GitHub and is quite straight-forward, it took me less than two hours to setup a VM and do it when I needed it.

Lester Caine

unread,
Oct 11, 2025, 3:03:57 AMOct 11
to Firebird-PHP
Paul ... 
I've jumped from 7.2/3 direct to 8.4 and am currently using the PDO driver with ADOdb on my live websites. https://lsces.uk/wiki/Firebird+PHP+Test+Script+ibtest gives a little information on the hoops and what is currently available. 
That said, you need a driver built for the php version you are trying to use, so will need to manually build an 8.0.0 or 8.1.0 version using phpize and the like and https://github.com/FirebirdSQL/php-firebird will work fine using that process. 
I'm using php-fpm to provide PHP in nginx and the older server still has PHP 7.3, 7.4, 8.3 and 8.4 on different ports to allow me to toggle back to older code, but all the current stuff is now fairly clean 8.4 code. https://lsces.uk/wiki/Multiple+PHP+versions+on+Nginx?highlight=php-fpm is the latest crib sheet to help with that.
Should add that I'm also running Firebird 5 although FB3 is still live on the old windows box just as a backup.

Paul Vinkenoog

unread,
Oct 11, 2025, 10:38:53 PMOct 11
to firebi...@googlegroups.com, Firebird-PHP
Hi Emil, hi Lester,

Thanks for your comments and suggestions, both.

Yes, of course I should have used the matching driver in the first place
and not long after posting my earlier meassage I did just that.

Unfortunately, it still didn't work. The phpinfo() output shows that the
Interbase extension is loaded and the parameters are the same as on
other servers where I have similar applications running.

But on this particular server, each connection attempt results in
"Unable to complete network request to host "localhost". Failed to
establish a connection." - regardless of the target. (Same story
when using the full hostname, or trying to connect to a remote host.)

Meanwhile, the server on localhost is happily wating for connections
and perfecty reachable, be it with isql to localhost or from remote
clients, with isql or FlameRobin.

So the conclusion _would_ be that the driver file is the wrong one, or
corrupted, but it isn't.

I have now configured my php and firebird _exactly_ the same as on
another server where they work perfectly, and compared the driver files
(they turned out to be bit-for-bit equal).

But that one server works painlessly, and the new one fails. Firebird
works fine, PHP works fine, the app works, interbase.so loads without
errors, but connections fail. It's not SElinux either: I set it to permissive
when the trouble started, but to no avail.

I'm clueless and will have to face the customer in 1,5 day.

If anybody has a tip, I'd be grateful.

BTW, I *do* plan to switch to PDO. But that doesn't help for now;
I'll have to do a lot of rewriting for that.

Cheers!

Paul Vinkenoog

Lester Caine

unread,
Oct 12, 2025, 2:48:29 AMOct 12
to Firebird-PHP
"(they turned out to be bit-for-bit equal). " ... curiously they should not be, since they should have the ID for the version of php included? But if phpinfo is showing say 8.0.0 and the driver ID does not match then it will not load  :(
One thing that caught me out initially was tumbleweed picking up IT'S version of PHP rather than the one I was trying to build hence the notes on 'Multiple PHP Versions' to make sure that the actual version I wanted to build was being used for all stages.
I have to admit that while I did try stepping through 8.0, 1 and 2 when updating my code base, I found it a thankless exercise so I've not actually seen if those version do actually run ... but I don't see why they would not! The version I'm running on 7.3/4 and 8.3/4 is built with the crib sheet and the current code from github but again the production stuff here is on PDO and I've only really tested the interbase driver with the test demo. 

Which version do you actually need and I'll have a go building it here and see what I find ...

Paul Vinkenoog

unread,
Oct 12, 2025, 7:36:43 AMOct 12
to firebi...@googlegroups.com, Firebird-PHP
Hi Lester,

In this case, they should be equal, because in order to (try and) make
it work, yesterday I installed the exact same Firebird and PHP versions
on the new system (where I have the problem) as on two existing
systems where it works flawlessly.

The configuration is as follows.

PHP:
php83-php.x86_64 from the @remi-safe repo, version 8.3.26-1.el9.remi

Firebird:
firebird.x86_64 from the @epel repo, version 4.0.6.3221-1.1.el9

Driver:
php_8.3.0-interbase-3.0.1-linux-x64.so
(346136 bytes)

phpinfo reports in the interbase section:

Firebird/InterBase Support dynamic
Interbase extension version 3.0.1
Compile-time Client Library Version Firebird API version 30
Run-time Client Library Version LI-V6.3.6.3221 Firebird 4.0

This is the same for all three systems: the two that work and the one
where connections fail.

They're all running under Almalinux 9.6

*If* you could find the time to build a driver, I'd be most grateful and of
course more than happy to pay you for your time. The customer already
gave me 12 days extra time (ending tomorrow) due to earlier unforeseen
complications, and I'd hate to ask for more. That doesn't make me look
good. But if it has to be, it has to be.

As has become clear by now I guess, I need a working driver for PHP
8.3.26, Firebird 4.0.6, Linux x64.

Cheers,
Paul Vinkenoog

Emil Totev

unread,
Oct 12, 2025, 8:09:09 AMOct 12
to firebi...@googlegroups.com
Hi
I found on one of my systems an 8.3 interbase.so file, with the same length as the one you have, and though PHP is upgraded there, I am sure it worked before that.

Actually, I don't think your problem lies with the PHP driver, it must be something else. Are you sure you are using exactly the same connection string in PHP that works with isql and flamerobin? Or could it be something with IP4 vs IP6? You could also try with the actual host name or directly with 127.0.0.1.

Best regards
Emil
 


--
You received this message because you are subscribed to the Google Groups "Firebird-PHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-php...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/firebird-php/gu0nekhmmlafkupvmens9tm9b4hij0nrc3%404ax.com.

Paul Vinkenoog

unread,
Oct 12, 2025, 8:59:06 AMOct 12
to firebi...@googlegroups.com, firebi...@googlegroups.com
Hi Emil,

Yes, I've tried 127.0.0.1 and the full hostname, and that didn't work.
Nor do outbound connections to any host (at least with PHP; with
isql everything works).

I'll look into the IP4 vs IP6 thing, though!

Cheers,
Paul Vinkenoog

Lester Caine

unread,
Oct 12, 2025, 10:56:07 AMOct 12
to Firebird-PHP
I think I'd be working along Emil's line ... it would not be the first time I've had two identical machines giving a problem which was eventually tracked down to something network related :(
Flamerobin often flags if I've cocked up the firebird config as I'm still using 'legacy' even with FB5 so the fact that you are connecting via that says one thing. I'd try the pdo driver as well as a cross check. The ibtest scripts are useful at times ;) https://lsces.uk/wiki/Firebird+PHP+Test+Script+ibtest
Are the working machines networked so you can use the copy of firebird on there in place of the local copy? My setup just needs the machine name changed and I can see the live database from the development machine ...
Getting network tidy on tumbleweed has had me pulling my hair out at times, but everything is now working transparently.

Paul Vinkenoog

unread,
Oct 12, 2025, 11:20:20 AMOct 12
to firebi...@googlegroups.com, Firebird-PHP
Hi Lester, and all,

It turned out one of the GPT-5 suggestions hit the spot. Big thanks
to Carlos! :-)

Indeed, although the policy was set to 'permissive', connections originating
from httpd were blocked. When I enabled them, the connection to the main
database of the application succeeded.

Strangely though, a secondary connection to a local postcode database
seemed to fail silently. This db is approached by a php script that gets
called by the main program via Ajax and works well on other installations.

Since here too, it is eventually httpd that tries to connect to the database,
I would expect it to work.

(Perhaps needless to say, but connections to this db via isql and FR work,
also from remote.)

I'm still investigating this but in the meantime, if someone has a suggestion,
please let me hear it ;-)

Cheers,
Paul Vinkenoog

Guilherme Souza

unread,
Oct 12, 2025, 11:25:53 AMOct 12
to firebi...@googlegroups.com
We use PHP 8.2 with interbase from Ubuntu, maybe you can use this one on your Linux distro 

Lester Caine

unread,
Oct 12, 2025, 11:44:50 AMOct 12
to Firebird-PHP
Paul ... have you tried accessing a remote copy of the postcode database from httpd ?
Just built 8.3.26 clean as fpm module and about to build php-firebird but need to clear the '502 Bad Gateway' first ... tmp directories will be missing :(

Paul Vinkenoog

unread,
Oct 12, 2025, 12:08:58 PMOct 12
to firebi...@googlegroups.com
Hi Lester,

I just did, but that didn't work either.

Paul

Lester Caine

unread,
Oct 12, 2025, 12:32:09 PMOct 12
to Firebird-PHP
Try https://myhomecloud.uk/storage/common/firebird/interbase.tar.gz ( called interbase.so inside )
It's build on PHP8.3.26 with the githib code for php-firebird.5.0.2 and the 8.4 version is what I've been using 
Need to break for something to eat but I'll finish the 8.3 extensions I need to run ibtest.php after I've eaten!

Paul Vinkenoog

unread,
Oct 12, 2025, 12:34:48 PMOct 12
to firebi...@googlegroups.com
Thank you very much indeed, Lester.

I have to go and get something to eat first too now.

Later!
Paul

Lester Caine

unread,
Oct 12, 2025, 2:51:56 PMOct 12
to Firebird-PHP
I'm hitting a bit of a problem testing it ... 8.4 is working fine, but 8.3 is not filling in the page on ibtest.php ... need to sort xdebug as the copy I have is complaining it only works up to 8.2 yet I have it working fine with 8.4 ... going around in circles a bit at the moment and not seeing ANY errors displayed so far :(

Lester Caine

unread,
Oct 12, 2025, 3:04:24 PMOct 12
to Firebird-PHP
Mystery solved ... BcMath only appeared in PHP8.4 so I just needed to remove the INT128 tests ... driver is working fine here on 8.3 

Carlos H. Cantu

unread,
Oct 12, 2025, 3:09:57 PMOct 12
to firebi...@googlegroups.com
Glad it helped 😉

[]s
Carlos

Em dom., 12 de out. de 2025, 12:20, Paul Vinkenoog <pa...@vinkenoog.nl> escreveu:

Paul Vinkenoog

unread,
Oct 12, 2025, 3:57:03 PMOct 12
to firebi...@googlegroups.com
Hello Lester,

My main problem was solved when I set the correct sebooleans
to give httpd permission to make network connections.

The main page loads fine now, but one of the two scripts that
are called with Ajax doesn't execute, or rather: it doesn't return
data as it should. And if I put error_log calls inside to monitor
what's going on, they don't show up in the log :-(

Oddly enough the other script _does_ respond. They are both in the
same subdir, have the same permissions and perform similar tasks.

I don't know if this has anything to do with the interbase driver, but
if and when you have a new build ready, can you please put that
online as well? Currently there's an empty gz at that location....

Cheers,
Paul

Lester Caine

unread,
Oct 12, 2025, 4:16:22 PMOct 12
to Firebird-PHP
"Currently there's an empty gz at that location.... " shouldn't be :( I'm seeing a 210.5K file and I've confirmed that it IS working fine. Just pulled a copy myself and am running that
Have sent a copy direct ;) 

Paul Vinkenoog

unread,
Oct 17, 2025, 7:38:45 PMOct 17
to firebi...@googlegroups.com
Hi all,

A big *thank you* to everybody who came up with suggestions and
helped me solve this.

As written earlier, the main culprit turned out to be SELinux, which
blocked database connections from httpd even in permissive mode
- go figure.

The problem that remained after that (connection to another db still
failing) was my own fault: I accidentally switched two letters in a
variable declaration. There ought to be a law, really ;-)

Cheers,
Paul Vinkenoog
Reply all
Reply to author
Forward
0 new messages