[Pkg-firebird-general] php4-interbase and classic

Damyan Ivanov divanov@creditreform.bg
Wed, 01 Sep 2004 13:44:23 +0300

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

(Sorry for the long post. I need to explain a lot of things...)

Hi, Remco,

This morning I had hard time in figuring out why my apache-perl fails to 
start and I blame php4-interbase 4.3.8-1 for this. Please read on for 

Since this morning my apache hangs on `apache-perlctl start' with two 
processes (the master and one child) consuming all the CPU. Killing the 
master is possible, but thi child is only killed by SIGKILL.

I started looking at my httpd.conf and it appeared that if I enable more 
than one VirtualHost, apache-perl hangs as described. With only one 
VirtualHost it starts ok.

However, the single VirtualHost I was trying is my web application that 
uses IBPerl to connect to Firebird. Since this morning IBPerl croaks 
that it is unable to complete the network request to "localhost" on 
connect. I use classic and local database, so nothing is listening on 
the loopback interface... I started debugging why IBPerl tries to make a 
network connection while given a local file to connect to.

I was able to connect to local files using either isql-fb or pisql.pl - 
an IBPerl implementation of isql. The problem remained only within my 
web application.

So I decided to try connecting with ibwebadmin and it failed with the 
same miserable error - "unable to complete network request to host 
localhost". So I suspected this morning's upgrade og php4-interbase and 
removed it (along with ibwebadmin, I'm afraid). Everithing runs fine 
after this. I enabled all the VirtualHosts and there is no problem.

I see that php4-interbase depends on libfirebird2-super (>= 1.5.1-2) | 
libfirebird2, which suggests that it is compiled against 
libfirebird2-super and apache loads php4-interbase along with 
libfbclient (the super library) and later refuses to load libfbembed, 
which is needed for the local connections to work.

While I myself use classic, my roommate just installed super and he had 
no problems whatsoever with IBPerl and php4-interbase.

My first thought was to recompile php4-interbase linked with libfbembed 
(from libfirebird2-classic) to allow local connections too. And I did.
I recompiled php4-interbase with libfirebird2-classic installed. It 
linked with -lgds (which is a symlink to libfbembed) and now everithing 
works fine - both IBPerl and php4-intarbase can connect to local and 
remote databases.

So far so good, but the resulting package is not installable on my 
roommate's system, since it depends on libfirebird2-classic. :-(

I am quite sure that libfbembed (libfirebird2-classic) can work with 
both local and remote connections, I am not sure whether it can 
cooperate with local super-server. Even if it can, I can't find a way to 
ling php4-interbase with lingds - ldd always shows libfbembed. So a 
php4-interbase compiled with libfirebird2-classic will not work with 
libfirebird2-super and vice versa.

Can you thing any way out of the situation? One is to provide two 
packages - php4-interbase-(classic|super), but this is unnecessary 
bloat. Both libfbembed (classic) and libfbclient (super) have the same 
API, so in theory they are interchangeable. The only difference is that 
libfbembed can connect locally.

Other possible solution is to link php4-interbase with libgds, but make 
ld not resolve the link on link time, so ldd shall report libgds.0, 
which shall link to the installed library (super or classic) on runtime. 
I don't know whether this is possible though.

Third solution is to change libfirebird2-classic and libfirebird2-super 
and make libgds.so hard link to the corresponding libfbembed or libfbclient.

What do you think? Whick solution is doable/best?


Damyan Ivanov                             Creditreform Bulgaria
divanov@creditreform.bg             http://www.creditreform.bg/
phone: +359(2)928-2611, 929-3993           fax: +359(2)920-0994
mobile: +359-88-856-6067      ICQ: 3028500      Y!M: dam3028500

Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

Version: GnuPG v1.2.5 (GNU/Linux)