Subject firebird with php - apache configuration
Author mikaelderrien
Hi,

i'm Mikaƫl, from france, and i met some troubles with the use
of php for firebird, that you may have already encounter.
i installed firebird superserver RC4 on a suse 8.2, ant it runs
well. i also use an apache web server (1.3.27) configured with
php support, there's no problem. i use webmin to do easily the
administration. i want to use ibWebAdmin 0.91 and installed it.
i've modified the file inc/configuration.inc.php to fit to my
installation, following the comments, i don't think there are
troubles due to my changes, i can copy it here if you judge it
necessary. Then, in a web browser :
http://localhost/ibwa.html
processed to
http://localhost/ibwa/database.php (through aliases)
i got this error messages (*)
Your php installation misses the interbase support !
Recompile your php and configure --with-interbase[=DIR]
or edit your php.ini to load interbase.so
i've looked in /etc/php.ini and /etc/httpd/httpd.conf, i've
also read the file about DSO in the html manual docs provided
with apache. As i understand it, things mus go this way :
* in /etc/php.ini, section ;Dynamic Extensions; add the line
extension=mod_firebird.so to [extension section], the file will
be found in /usr/lib/apache with others DSO librairies. Then
in section ;Module Settings; add a section [firebird], that will
be useful the day i'll find what the **** to put in. Indeed, this
might not be necessary since firebird options are set up in
firebird/firebird.conf, except for magic quotes.
* in inc/script_start.inc.php, replace interbase.so in :
if (!in_array('interbase', get_loaded_extensions())) {
@dl('interbase.so') || @dl('interbase.dll');
by mod_firebird.so, don't care about the dll.
* in /etc/httpd/modules/ create the file mod_firebird with
these lines inside :
Variable:HTTPD_SEC_MOD_FIREBIRD
LoadModule:LoadModule firebird_module /usr/lib/apache/mod_firebird.so
AddModule:AddModule mod_firebird.c
Text:firebird
Include:/etc/httpd/mod_firebird.conf
don't you recognize mod_firebird.so ? great :) let's see about
Include
* in /etc/httpd/ create the file mod_firebird.conf with these lines
inside :
Listen 80
Listen 8099
Listen 8101
Listen 8102
NameVirtualHost name.domain:8099
NameVirtualHost name.domain:8101
NameVirtualHost name.domain:8102
ServerName name.domain
<VirtualHost name.domain:8099>
Port 8099
</VirtualHost>
<VirtualHost name.domain:8101>
Port 8101
</VirtualHost>
<VirtualHost name.domain:8102>
Port 8102
</VirtualHost>
this should deal with apache web server and virtual hosts, at least
i hope so.
* in /etc/sysconfig/apache add the lines :
## Type: yesno
## Default: "no"
#
# enable mod_firebird module
#
HTTPD_SEC_MOD_FIREBIRD=yes
(remember the first line of /etc/httpd/modules/mod_firebird ?)
* in /etc/httpd.conf, in ### Section 1: Global Environment
add the lines
LoadModule firebird_module /usr/lib/apache/mod_firebird.so
and
AddModule mod_firebird.c
to section # Dynamic Shared Object (DSO) Support.

And now, what's about this mysterious mod_firebird.so ?
As i explained in dos.html and apxs.html, this module is build by
the command
$ apxs -c mod_firebird.c
So, what's about mod_firebird.c ? I just need to write it... but
this is far
too much complicated for me. I saw mod_php4.c and other source code
files for
creating modules with apxs, however i'm able to develop this kind of
file...
and basically understand what they're supposed to do.

i haven't found 'mod_firebird.c' or something similar, neither by
apache web site
nor by suse web site, so if someone has it, i'm very interested :)

Then, i found a file called interbase.so on yahoo firebird-support
forum and decided to
tried it so i made the right changes, following what i explained
upon,
in inc/script_start.inc.php, httpd.conf and php.ini and copy
interbase.so to
/usr/lib/apache/ then restarted apache services (apply changes)
and... it failed :|
quite logically, because versions of applications weren't the same :

Failed to start apache :

Starting httpd [ Mailman Midgard PERL PHP4 Python ZopeKeepHomes ]

Syntax error on line 263 of /etc/httpd/httpd.conf:
Cannot load /usr/lib/apache/interbase.so into server: libgds.so:
cannot open shared object file: No such file or directory
..failed

i think, in interbase.so, 'libgds.so' should be replaced by
libfbclient.so, maybe...
if i had interbase.c ; so, now, i don't know what to do.

Apart from this, i've also installed SQLLY developpment IB admin 4
but this dosn't work :
# /opt/ibadmin4/bin/ibadmin4
gives me several 'QPopupMenu: (unnamed) Popup has invalid menu item'
messages and the followings
Exception EIBClientError in module IBAdmin4 at 0810AE0A.
InterBase library gds.so.0 not found in the path. Please install
InterBase to use this functionality.

so i guess i need to install interbase to get its library althouh
www.sqlly.com writes clearly that their
product runs with firebird 1.5

QUESTIONS

- i noticed a file in /usr/lib/mysql/, where are located
libmysqlclient.so*, called libmysclient.a
and that provide informations for linking the library, like
dependencies, directories...
could it be an exploitable example for firebird or this idea is just
useless and stupid ?

- i thought that php integrated firebird support, since you can find
the files ibase.php in
/usr/share/php/DB/ or ibase.h and gds.h in firebird/include

- this is not directly linked, but what's the function of
firebird/lib/libib_util.so ?

for the moment, i've found a file called mode_example.c, in apache
2.0.47 package, and i'll try
to create my own mod_firebird.c starting from that but it's quite
sure it'll fail.

any comment, advice, hint, idea or even solution ;) is welcomed :)
because until now i still don't know how to make firebird, php and
apache run altogether.

fanx for reading
M.