Friday, March 14, 2014

php5 and firebird pdo on ubuntu / debian

The recommendd method is to use the official php5 source from ubuntu or debian and build only the pdo firebird extension and install it
sudo apt-get install php5-dev firebird2.5-dev php-pear devscripts debget

You need to build the pdo extension from php from ubuntu source code here is the source for php package (apt-get source will do the job for any release)
apt-get source php5
cd php5-*
cd ext/pdo_firebird
sudo ln -s /usr/include/php5 /usr/include/php
sudo make install 

Check to have in php.ini to have the next lines also with phpinfo() function

sudo pico/vi /etc/php5/conf.d/pdo.ini
# configuration for php PDO module

php -i | grep PDO
PDO support => enabled
PDO drivers => firebird
PDO Driver for Firebird/InterBase => enabled

you can also check in apache if all is correct
by creating a page in /var/www/pdo_info.php
with this content

then in the browser press F3 and search PDO
to check if all is ok with the driver then create one small example that loads the driver and then is connecting to the database server

after the driver is loaded now you can use the pdo as usual , here is the fetch example


Bambang Pranoto said...

Is there a way to set transaction isolation in firebird pdo? Thanks.

hectorh30 said...

Incredible useful! some years later.. didn't know about apt-get source (:


jeflores01 said...

hi, how can i enable it for mac??

Popa Adrian Marius said...

how did you installed on mac , usuall if is a binary package you need to search howto compile the firebird pdo extension only

usually you go to the same php source version like the binary in the pdo firebird folder , execute phpize and then configure make , make install

also you can ask on firebird-php list

Unknown said...

Very useful, Thanks a lot

otama said...

Why is the bug of "" not revised for a long term?
For my program, this bug is fatal.
Therefore PDO is not available.

I cannot use many frameworks and libraries depending on PDO

In addition, many bugs seem to be left elsewhere.

Popa Adrian Marius said...

I will check the patch correctness

There are a few bugs open but i need to check and verify if the patch or solutions are correct (debug and tests)