Which Oracle extension should you use? Some guidelines are:
- If you want DB independence, consider PDO or an abstraction layer like PEAR DB (or PEAR MDB2) or ADOdb.
- If you want to make full use of Oracle features and want high performance consider oci8. I've mostly worked with oci8; PDO is much newer since it first came out with PHP 5.1.
Where do you get the extensions? One option is to download PHP 5.1.2. This has the re-factored oci8 and PDO.
You can also get the re-factored oci8 for older versions of PHP including PHP 4, since the oci8 code compiles with PHP 4 and PHP 5.
All methods of getting oci8 derive from PHPs CVS:
- The oci8 extension code is under continual maintenance in PHP's CVS source code control system. Anyone can access CVS and pull the code. (Anyone can contribute too). You can update your PHP environment by getting this source code and recompiling. It may be relatively unstable because it is under development.
- PHP Extension Community Library (PECL) source code snapshots for oci8 are taken from CVS when it is in a known stable state. Windows binaries for oci8 compiled with various versions of PHP are on pecl4win. The version marked 1.2 is the re-factored extension.
- Each new release of PHP includes the most current CVS code. The re-factored oci8 was picked up in PHP 5.1.2. Older versions of PHP have the old oci8 code.
- Zend Core for Oracle (ZCO) takes snapshots from CVS and bundles them. ZCO has the re-factored oci8 extension and is not only the easiest way to install PHP, but gives you the option of a fully supported stack. ZCO currently uses PHP 5.0, so it does not have PDO.
The schedules of PHP releases, PECL snapshots and ZCO are not fully synchronized but currently the oci8 in ZCO 1.3.1 and PECL's oci8 1.2 are pretty close to each other.
PDO is a separate code base. It is also in CVS and has PECL snapshots created. It is not compatible with older versions of PHP.