Installing PHP 5.3.x On Ubuntu Karmic with Firebird PDO support

Created by: Lester Caine, Last modification: 20 Dec 2009 (21:23 GMT)

Installing PHP 5.3.x On Ubuntu Karmic with Firebird PDO support
Created by: Popa Marius Adrian,Last modification on 20 Nov 2009 [13:33 UTC]

There is no php 5.3 in Ubuntu karmic so we have to install it by compiling it with pdo and firebird support

1. Install apache2

install apache2 apache2-mpm-prefork apache2-prefork-dev apache2-utils apache2.2-common

2. Install firebird dev packages

sudo apt-get install firebird2.1-dev

3. remove any installed packages that are with php

dpkg --get-selections | grep -v deinstall | grep php

in my case is something like this

sudo apt-get purge libapache2-mod-php5 php-pear php5-common php5-interbase php5-gd php5-mysql php5-xdebug

4. Install dependencies needed to build the php5 package

sudo apt-get build-dep php5
sudo apt-get install libmcrypt-dev

5.Get the source from us mirror I use the latest php 5.3.1 but you can use the latest stable

wget http://us.php.net/distributions/php-5.3.1.tar.bz2
tar -jxvf php-5.3.1.tar.bz2

6.Run the configure script with common options and also enable interbase and pdo_firebird extension

./configure --prefix=/opt/php5.3.x --with-apxs2=/usr/bin/apxs2 --with-interbase=/usr  --with-tidy=/usr 
--with-curl=/usr/bin --with-curlwrappers --with-openssl-dir=/usr --with-zlib-dir=/usr --enable-mbstring 
--with-xpm-dir=/usr --with-pdo-firebird=/usr --with-xsl=/usr --with-xmlrpc --with-iconv-dir=/usr --with-snmp=/usr  
--with-bz2=/usr --with-mcrypt=/usr --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr 
--with-freetype-dir=/usr --enable-mbstring --enable-zip --with-pear

Here is the code for configure script

http://gist.github.com/224218

7. Install php and module

sudo make -i install 

8.Add the PHP Module to Apache

cd /etc/apache2/mods-available

Create a new file called php5.load and paste the following line into it:

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so

Now create another file called php5.conf and paste the following into it:

AddType application/x-httpd-php .php 

9.Just need to enable the module and restart Apache:

sudo a2enmod php5
sudo /etc/init.d/apache2 restart

10.Write a Firebird pdo script in /var/www http://gist.github.com/224223 and run it with http://localhost/test.php