Centos 5.X – Build Firebird / Interbase (extension and PDO extension) support into PHP
Sent by Luis Rodrigues <luisrodrigues.pt@gmail.com>
1º # Install Firebird
# for this tutorial I use FirebirdSS-2.5.0.26074-0.amd64.rpm (downloaded by Firebird website)
rpm -ivh FirebirdSS-2.5.0.26074-0.amd64.rpm2º Obtain php source code
a)
# create the /etc/yum.repos.d/CentOS-SRPMS.repo with the following content[base-SRPMS]
name=CentOS-$releasever – Base SRPMS
baseurl=http://mirror.centos.org/centos/$releasever/os/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
enabled=1#released updates
[update-SRPMS]
name=CentOS-$releasever – Updates SRPMS
baseurl=http://mirror.centos.org/centos/$releasever/updates/SRPMS/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
priority=1
enabled=1b)
yum install yum-utils
yumdownloader –source php3º # Install php-devel for phpize
yum install php-devel######################################################
# if you want to build interbase.so extension only
######################################################4º # change to the folder where the extension code is and run the following command set.
cd /usr/src/redhat/BUILD/php-5.1.6/ext/interbase
phpize
./configure –with-interbase=shared,/opt/firebird
make5º # the extension interbase.so if builded sucessfully is located at:
/usr/src/redhat/BUILD/php-5.1.6/ext/interbase/modules6º i’m using 64bits system so i need to copy the extension
cp interbase.so /usr/lib64/php/modules7º last we need to activate extension into PHP
vi /etc/php.ini#add the following line do extensions section
extension=interbase.so
#######################################################
# if you want to build Firebird Driver
#######################################################
4º # change to the folder where the extension code is and run the following command set.
cd /usr/src/redhat/BUILD/php-5.1.6/ext/pdo_firebird
phpize
./configure –with-pdo-firebird=/opt/firebird/
make5º # the extension interbase.so if builded sucessfully is located at:
/usr/src/redhat/BUILD/php-5.1.6/ext/pdo_firebird/modules6º i’m using 64bits system so i need to copy the extension
cp pdo_firebird.so /usr/lib64/php/modules7º last we need to activate extension into PHP
#to work PDO driver need PDO (if you don’t have it, install it using yum)
yum install php-pdovi /etc/php.ini
#add the following line do extensions section
extension= pdo.so
extension= pdo_firebird.so8º restart apache
service httpd restart