Firebird PHP Linux PDF
Firebird PHP Linux PDF
Iman Suyoto
Linfox Armaguard IT, Australia
4 March 2008 v.1.0.1
Table of Contents
Setting up PHP and Firebird on Linux .................................................................................................... 3
Preparation ..................................................................................................................................... 3
Build and Installation ..................................................................................................................... 3
Testing .......................................................................................................................................... 4
Appendix A: Document History ............................................................................................................. 6
Appendix B: License Notice ................................................................................................................... 7
2
Setting up PHP and Firebird on Linux
This paper offers a succinct description of the steps we took to set up PHP 5 on Linux to work with Firebird.
Preparation
1. Obtain the source code of Apache HTTP Server (2.2.8): http://apache.wildit.net.au/httpd/httpd-2.2.8.tar.
bz2
4. Be prepared with the path to Firebird installation in your system (e.g. /opt/firebird) and the paths to
which you would like Apache and PHP to be installed, e.g. /yourhome/inst/httpd and /yourhome/
inst/php respectively.
Apache
cd /yourhome/apps/httpd-2.2.8
make
make install
PHP
cd /yourhome/apps/php-5.2.5
./configure --with-interbase=/opt/firebird/ \
3
Setting up PHP and Firebird on Linux
--with-apxs2=/yourhome/inst/httpd/bin/apxs --disable-libxml \
--prefix=/yourhome/inst/php
make
make install
Note
These switches—
--disable-libxml \
--disable-dom --disable-simplexml --disable-xml \
--disable-xmlreader --disable-xmlwriter --without-pear
—are specific to our system, as pear uses XML and we don't have libxml installed in our system. If you
have libxml in your system, of course these switches are unnecessary.
Testing
Run the following script. Make sure that the Firebird example employee database is at the location specified
in $dbname.
<?php
header("Content-Type: text/plain");
$dbname = '/opt/firebird/examples/empbuild/employee.fdb';
$dbuser = '';
$dbpassword = '';
die(ibase_errmsg());
#
#
$sql = "SELECT * FROM Country";
echo ibase_num_fields($result);
while($row=ibase_fetch_object($result))
4
Setting up PHP and Firebird on Linux
ibase_free_result($result);
ibase_close($res) or die(ibase_errmsg());
?>
5
Setting up PHP and Firebird on Linux
Appendix A:
Document History
The exact file history is recorded in the manual/src/docs/papers module in our CVS tree; see http://
sourceforge.net/cvs/?group_id=9028
Revision History
1.0.0 3 Mar 2008 (Ed.) Original version, reproduced from WP file submitted by Bill Katelis.
1.0.1 4 Mar 2008 (Ed.) Author Iman Suyoto added some notes, boss Bill Katelis added some
author details.
6
Setting up PHP and Firebird on Linux
Appendix B:
License Notice
The contents of this Documentation are subject to the Public Documentation License Version 1.0 (the “Li-
cense”); you may only use this Documentation if you comply with the terms of this License. Copies of the Li-
cense are available at http://www.firebirdsql.org/pdfmanual/pdl.pdf (PDF) and http://www.firebirdsql.org/man-
ual/pdl.html (HTML).
The Initial Writer of the Original Documentation is: Iman Suyoto, Linfox Armaguard IT, Australia.