Archive for September, 2009

How to install PHP PDO_OCI on Ubuntu Jaunty

This is a revamped guide, previously wrote for gutsy, enjoy!

1) prerequisites

First of all we’ll install the php5-dev package which contains some utilities we’ll need for the build process:

sudo apt-get install php5-dev

then you’ve to find out your ORACLE_HOME environment variable, try executing:

env | grep ORACLE_HOME=

If this command outputs something like:

ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

then you can jump to section “2) Getting and compiling PDO_OCI” otherwise go on thru this section.

If this guide we’ll just see how to find out which is your ORACLE_HOME directory if you’ve installed the oracle-xe server package. If you’ve installed instantclient or anything else please refer to the product documentation. So you’ve an installed and configured oracle-xe instance on your machine, now type:

cat /etc/init.d/oracle-xe |grep ORACLE_HOME=

the command should print something like:

ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

now we’ve to export this variable to the current terminal session, we’ll do that with this command:

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

and the environment variable will be configured.

2) Getting and compiling PDO_OCI

Just cut and paste these simple commands to download PDO_OCI from the web and prepare it for the build phase:

cd /tmp
pecl download pdo_oci
tar xvfz PDO_OCI-1.0.tgz
cd PDO_OCI-1.0
phpize
mkdir include
ln -s /usr/include/php5/ include/php
./configure

now everything should be setup and we can build the driver and install it with:

make && make install

If everything is fine you can continue

3) Configuring PHP and Apache

if everything is fine you can go on editing your php.ini file and adding this line:

extension=pdo_oci.so

now create a phpinfo.php file under your apache’s document root, containing this line:

<?php phpinfo();

point your browser to:

http://localhost/phpinfo.php

and search for the “environment” section, it should look like the one in the next screenshot:
environment variables
if you see the ORACLE_HOME line everything it’s ok, jump to the “4) Closure” section otherwise edit /etc/apache2/envvars file and add the ORACLE_HOME configuration, it will be something like this (on a single line):

export ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server

4) Closure

Restart your apache and you’re done:

sudo /etc/init.d/apache2 restart

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine

P4A 3.4.1 is out

Hello everybody, the new release of our beloved PHP Framework is ready to be downloaded, this is a maintenance release but we’re adding a frequently requested feature, DB logging and profiling! Just take a look at the “products_catalogue”’s index.php and check the new P4A_DB_PROFILE constant, enable it and run the application to find our how easy is to take care about your DBs :-)

Full changelog:

- strong/em are now supported by P4A tooltips
- DSN charset support was added to set DB connection charset
- Zend Framework was updated to 1.9.2
- jquery::maskedInput plugin was updated to 1.2.2
- P4A_Object::__call() method was changed from private to public for PHP 5.3 compliance
- P4A_Tab_Pane’s CSS padding was changed a bit to fix a rendering bug on firefox/chrome
- P4A_DB_PROFILE constant was added, it will output every query executed on every DB

Download P4A 3.4.1

Share/bookmark:
Digg StumbleUpon Facebook Reddit Mixx del.icio.us Google Live NewsVine