PHP PECL PEAR: Installing php extensions such as db2 client.

Know that there are two approaches. Using PECL or statically compile the extensions. See towards the end of the document for a resolution and links to see the answer. The static approach uses the standard build system of unix that uses configure and make. Clearly the PECL approach is easier for newbies like me.

After all the research the bottom line answer is at this url

satya - Tuesday, July 05, 2011 10:57:34 AM

install ibm db2 client software first

install ibm db2 client software first

satya - Tuesday, July 05, 2011 10:58:05 AM

what is php pear

what is php pear

Search for: what is php pear

satya - Tuesday, July 05, 2011 10:58:19 AM

what is pecl?

what is pecl?

Search for: what is pecl?

satya - Tuesday, July 05, 2011 11:00:06 AM

home page of pear: http://pear.php.net/

home page of pear: http://pear.php.net/

Not entirely helpful for a beginer.

satya - Tuesday, July 05, 2011 11:02:48 AM

here is a better introduction to what pear is

here is a better introduction to what pear is

satya - Tuesday, July 05, 2011 11:07:32 AM

So, what is PEAR?

The code in PEAR is partitioned in "packages". Each package is a separate project with its own development team, version number, release cycle, documentation and a defined relation to other packages (including dependencies). Packages are distributed as gzipped tar files with a description file inside, and installed on your local system using the PEAR installer.

satya - Tuesday, July 05, 2011 11:08:24 AM

repository for PEAR packages

All PEAR packages are registered in and downloaded from a central server at pear.php.net. Other third-party servers called "channels" also distribute packages that can be installed by the PEAR Installer, see the Channels list for more information. pear.php.net does not endorse the packages from these channels, and only provides support for packages distributed from pear.php.net.

satya - Tuesday, July 05, 2011 11:09:11 AM

Here is PECL home page

Here is PECL home page

satya - Tuesday, July 05, 2011 11:10:47 AM

PECL is another standard for writing/registerign php extensions

However PEAR installer can be used to manage maintain PECL extensions.

satya - Tuesday, July 05, 2011 11:23:49 AM

what is php-devel

what is php-devel

Search for: what is php-devel

satya - Tuesday, July 05, 2011 1:19:50 PM

how to php install pear

how to php install pear

Search for: how to php install pear

satya - Tuesday, July 05, 2011 1:22:22 PM

php and pear

The base installation that comes with the PHP distribution contains all the stuff that is needed to run the PEAR installation tools etc. If you have a recent installation of PHP, you can relax: The PEAR base installation is already there - unless you have compiled your PHP with the ./configure flag --without-pear.

satya - Tuesday, July 05, 2011 1:23:52 PM

Manually installign PEAR

Manually installign PEAR

satya - Tuesday, July 05, 2011 1:24:45 PM

summary of manual install


$ wget http://pear.php.net/go-pear.phar
$ php go-pear.phar

satya - Tuesday, July 05, 2011 1:48:02 PM

pecl ibm_db2 package

pecl ibm_db2 package

Search for: pecl ibm_db2 package

satya - Tuesday, July 05, 2011 1:49:22 PM

here is the link to download if your firewall is blocking

here is the link to download if your firewall is blocking

satya - Tuesday, July 05, 2011 1:50:55 PM

or download the latest from here

or download the latest from here

satya - Tuesday, July 05, 2011 2:42:22 PM

when you install a pecl module you are compiling sources...

when you install a pecl module you are compiling sources for that module. So if that module is dependent on other libraries you will prompted for their presense and their header files for completing the compilation process.

being a compile step you may also need a c compiler installed on such an OS.

satya - Tuesday, July 05, 2011 2:45:37 PM

php pdo ibm db2

php pdo ibm db2

Search for: php pdo ibm db2

satya - Tuesday, July 05, 2011 2:49:10 PM

setting up db2 for pdo an article from ibm docs

setting up db2 for pdo an article from ibm docs

satya - Tuesday, July 05, 2011 2:53:28 PM

Read about: php ibm_db2 pdo_odbc

Read about: php ibm_db2 pdo_odbc

satya - Tuesday, July 05, 2011 2:55:11 PM

quick summary of that link

ibm_db2 is an extension written, maintained, and supported by IBM for access to DB2 databases. The ibm_db2 extension offers a procedural application programming interface (API) that, in addition to the normal create, read, update, and write database operations, also offers extensive access to the database metadata. You can compile the ibm_db2 extension with either PHP 4 or PHP 5.

PDO_ODBC is a driver for the PHP Data Objects (PDO) extension that offers access to DB2 databases through the standard object-oriented database interface introduced in PHP 5.1. Despite its name, you can compile the PDO_ODBC extension directly against the DB2 libraries to avoid the communications overhead and potential interference of an ODBC driver manager.

satya - Tuesday, July 05, 2011 2:59:09 PM

Here are specific instructions from IBM

Here are specific instructions from IBM

satya - Tuesday, July 05, 2011 4:27:56 PM

pecl pdo_odbc install

pecl pdo_odbc install

Search for: pecl pdo_odbc install

satya - Tuesday, July 05, 2011 4:31:39 PM

download pdo_odbc driver

download pdo_odbc driver

This extension provides an ODBC v3 driver for PDO. It supports unixODBC and IBM DB2 libraries, and will support more in future releases.

satya - Tuesday, July 05, 2011 4:50:18 PM

pdo_ibm pdo_odbc what is the difference

pdo_ibm pdo_odbc what is the difference

Search for: pdo_ibm pdo_odbc what is the difference

satya - Wednesday, July 06, 2011 10:00:10 AM

pdo_ibm.so

pdo_ibm.so

Search for: pdo_ibm.so

satya - Wednesday, July 06, 2011 10:03:30 AM

primary reference for pdo_ibm on PECL

primary reference for pdo_ibm on PECL

satya - Wednesday, July 06, 2011 10:05:21 AM

pecl pdo_ibm download link

pecl pdo_ibm download link

satya - Wednesday, July 06, 2011 10:07:18 AM

db2 and php best practices on ibm: pdf file

db2 and php best practices on ibm: pdf file

satya - Wednesday, July 06, 2011 10:10:02 AM

Key pecl packages


ibm_db2
pdo_ibm
pdo_odbc

satya - Wednesday, July 06, 2011 10:14:33 AM

unix linux what is configure command?

unix linux what is configure command?

Search for: unix linux what is configure command?

satya - Wednesday, July 06, 2011 10:21:13 AM

here is an explanation of configure

here is an explanation of configure

satya - Wednesday, July 06, 2011 2:09:05 PM

what is config.m4 configure

what is config.m4 configure

Search for: what is config.m4 configure

satya - Wednesday, July 06, 2011 2:10:13 PM

The following link talks about how configure and php interacts with config.m4

The following link talks about how configure and php interacts with config.m4

satya - Wednesday, July 06, 2011 2:12:36 PM

pear and configure php

pear and configure php

Search for: pear and configure php

satya - Wednesday, July 06, 2011 2:21:19 PM

a bit more clarification on the configure tool

a bit more clarification on the configure tool

satya - Wednesday, July 06, 2011 2:38:53 PM

this is a real good introduction to configure: pdf file

this is a real good introduction to configure: pdf file

satya - Wednesday, July 06, 2011 2:43:19 PM

general idea of configure


download zip file of a package
unzip it
go to root of that package
run ./configure
make
make install

satya - Wednesday, July 06, 2011 3:02:49 PM

where does pecl install the downloaded pecl pacakges? See here:

where does pecl install the downloaded pecl pacakges? See here:

Then you need to change php.ini to enable the extension.

satya - Wednesday, July 06, 2011 3:04:35 PM

Alternatively here is how you can use php build system

Alternatively here is how you can use php build system

satya - Wednesday, July 06, 2011 3:05:41 PM

This later approach allows


Regenerate configure
statically compile your extensions into php
in this approach you will copy the extensions
  as a sub directory allowing the configure to work

satya - Wednesday, July 06, 2011 4:08:40 PM

More on m4 and php build system

More on m4 and php build system

satya - Wednesday, July 06, 2011 4:09:56 PM

whats up with gnu m4 macro processor

whats up with gnu m4 macro processor