The leading edge of scripting languages and Oracle Database brought to you by the Data Access Development team

  • php
    July 25, 2013

PHP OCI8 2.0.0-devel for Oracle Database is on PECL

Christopher Jones
Senior Principal Product Manager

PHP OCI8 2.0.0-devel is now available on PECL (and in the PHP 'master' branch). This is a development release, so changes may occur. I'm looking for feedback, particularly on:

  • Feature design, including naming choices
  • Install feedback from different platforms with different build tool versions
  • Whether to drop support for installing on PHP 4. I'm likely to do this. (The OCI8 1.4.10 release is usable for installing on PHP 4)

OCI8 2.0 can be installed as a shared extension from PECL with:

pecl install oci8-devel

Alternatively, if you have OCI8 1.x currently installed as a static extension, then you will need to build PHP again. This is easy using a trunk snapshot from snaps.php.net. Instructions for building are in various places on the web, including in The Underground PHP and Oracle Manual.

The OCI8 2.0.0-devel release contains a bunch of clean ups, and some new and changed features. The full list is found in the package.xml file:

- Added Implicit Result Set support for Oracle Database 12c.

Streaming of all IRS's returned from a PL/SQL block is available

via oci_fetch_array, oci_fetch_assoc, oci_fetch_object and

oci_fetch_row (but not oci_fetch or oci_fetch_all).

Alternatively individual IRS statement resources can be obtained

with the new function 'oci_get_implicit_resultset' and passed to

any oci_fetch_* function.
- Added DTrace probes enabled with PHP's generic --enable-dtrace
- Using 'oci_execute($s, OCI_NO_AUTO_COMMIT)' for a SELECT no

longer unnecessarily initiates an internal ROLLBACK during

connection close. This can improve overall scalability by

reducing "round trips" between PHP and the database.
- The oci8.event and oci8.connection_class values are now shown
only when the Oracle client libraries support the respective
- Connection statistics are now in a separate phpinfo() table.
- Temporary LOB and Collection support status lines in
phpinfo() were removed. These features have always been
enabled since 2007.
- The oci_internal_debug() function is now a no-op. Use PHP's
--enable-dtrace functionality with DTrace or SystemTap instead.
- Fixed a potential NULL pointer dereference flagged by Parfait
static code analysis.
- Extended testing of existing OCI8 functionality.
- Improved test output portability when using the PHP development
web server to run tests.
- Removed no-longer necessary Unicode patterns from tests
(vestiges of PHP's previous PHP 6 project)
- Improved build portability by removing compilation type cast
warnings with some compilers.
- Fixed compilation warnings when building with Oracle 9.2
client libraries.
- Updated code to use internal macro PHP_OCI_REGISTER_RESOURCE.
- Regularized code prototypes and fixed some in-line documentation
- Fixed code folding.

Subsequent blog posts will talk about the features in OCI8 2.0.0.

Join the discussion

Comments ( 4 )
  • Kissifrot Sunday, July 28, 2013

    Will you also improve oci_fetch_object, to be able to specify the class of the object to fetch the data into, and such things? (to "align" the signature to PDO's fetch, or mysqli/pgsql fetch_objct)

  • CJ Monday, July 29, 2013

    This hasn't been requested by anyone before. Can you log an enhancement request at https://bugs.php.net/report.php ?

  • Kissifrot Monday, July 29, 2013

    Well I thought it was in the works, but yes I just created an FR at https://bugs.php.net/bug.php?id=65354

  • CJ Monday, July 29, 2013

    Thank you.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.