Showing posts with label php5. Show all posts
Showing posts with label php5. 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

Saturday, January 31, 2009

installing apc on ubuntu

$apt-get install php5-dev
$wget http://pecl.php.net/get/APC-3.1.2.tgz
$tar -zxvf APC-3.1.2.tgz
$cd APC-3.1.2

$phpize
$./configure
$make
$sudo make install

cp apc.php /var/www

sudo vi /etc/php5/apache2/php.ini
add these lines
extension=apc.so

[apc]
apc.shm_size = 100
apc.cache_by_default = 1
apc.stat = 1

and restart the apache server

and load
http://localhost/apc.php

default username and password are apc and password
you can change them in /var/www/apc.php

sudo /etc/init.d/apache2 restart

Thursday, June 12, 2008

compiling php5-interbase extension from source
I assume that php5 is already installed and we have the source for php5.2.x
$cd php-5.2.6/ext/interbase
$phpize or /opt/php5.2.x/bin/phpize (if is installed there)
$./configure --with-php-config=/opt/php5.2.x/bin/php-config
$make ; sudo make install
add this extension to php.ini (at the end for example)

extension=interbase.so

restart apache
$sudo /etc/init.d/apache2 restart

Load phpinfo() and search for interbase extension

Thursday, May 08, 2008

install mcrypt on php (ubuntu)

sudo apt-get install php5-mcrypt
/etc/init.d/apache2 restart
php -i | grep mcrypt