Showing posts with label pdo. Show all posts
Showing posts with label pdo. Show all posts

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
phpize
sudo ln -s /usr/include/php5 /usr/include/php
./configure
make
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
extension=pdo.so
extension=pdo_firebird.so


php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => firebird
PDO_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

Saturday, April 18, 2009

use db wrappers in php don't write to mysql only

well pdo in php is very buggy , in fact i call it buggy as hell ,
http://www.alberton.info/php_pdo_firebird_status.html
http://forums.devshed.com/firebird-sql-development-61/firebird-and-php-pdo-functions-327659.html
I would recommend to use an stable wrapper around ibase/mysql functions
the one from cakephp is very well done you can find them in the cake
php source code
http://api.cakephp.org/class/dbo-firebird

also there is mdb2 with an good firebird/ibase driver

http://pear.php.net/package/MDB2
http://pear.php.net/package/MDB2_Driver_ibase/

also i have seen the adodb for php
http://adodb.sourceforge.net/
http://sourceforge.net/project/showfiles.php?group_id=42718

Friday, September 19, 2008

compiling pdo support in php - needed for phpmyfaq


or compiling php 5.2.x with pdo support all i did at configuration time is like adding
--with-pdo-firebird=/opt/firebird switch
then make; make install
Check the phpinfo() and pdo_firebird was there



cat config.nice
Code:
#! /bin/sh
#
# Created by configure

'./configure' \
'--with-apxs2=/opt/apache2.2/bin/apxs' \
'--prefix=/opt/php5.1' \
'--with-xml=shared' \
'--with-pdo-mysql=/opt/mysql-5.0.18/' \
'--with-pdo-firebird=/opt/firebird' \
"$@"


then download phpmyfaq

In my case 2.5.0 but the same apply to 2.0.8

http://www.phpmyfaq.de/download.php?do=download&number=2.5.0-alpha&ext=.tar.gz
unzip-it
tar -zxvf phpmyfaq-2.5.0-alpha.tar.gz
chown www-data.www-data phpmyfaq-2.5.0-alpha
chmod -R g+rw phpmyfaq-2.5.0-alpha
mv phpmyfaq-2.5.0-alpha phpmyfaq

and run the installer

http://localhost/phpmyfaq