Thursday Oct 24, 2013

PHP PECL OCI8 2.0 Production Release Announcement

The PHP OCI8 2.0.6 extension for Oracle Database is now "production" status. The source code is available on PECL. This can be used immediately to update your OCI8 extension in PHP 5.2 and later versions. The extension compiles with Oracle 10.2 or later client libraries. Oracle's standard cross-version database connectivity applies.

OCI8 2.0 and PHP 5.5.5 RPMs for Oracle and Red Hat Linux are available from oss.oracle.com. Windows DLLs are available on PECL for PHP 5.3, PHP 5.4 and PHP 5.5.

OCI8 2.0 source code will also be automatically included in the next major version of PHP.

New Functionality

  • Oracle Database 12c Implicit Result Set support. IRS's make it easy to pass query results back from stored PL/SQL procedures or anonymous PL/SQL blocks. Individual IRS statement resources, each corresponding to a single query, can be obtained with the new function oci_get_implicit_resultset(). These 'child' statement resources can be passed to any oci_fetch_* function. See Using PHP and Oracle Database 12c Implicit Result Sets and the PHP Manual: oci_get_implicit_resultset().

  • DTrace Dynamic Trace static probes. This well respected DTrace tracing framework is available on a number of platforms, including Oracle Linux. PHP OCI8 static user-space probes can be enabled with PHP's --enable-dtrace configuration option. See Using PHP DTrace on Oracle Linux. Documentation is also available in the PHP Manual OCI8 and DTrace Dynamic Tracing

Improved Functionality

  • 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.

Changed Functionality

  • PHP OCI8 2.0's minimum pre-requisites are now PHP 5.2 and Oracle client library 10.2. Later versions of both are usable and, in fact, recommended. Use the older PHP OCI8 1.4.10 extension when using PHP 4.3.9 through to PHP 5.1.x, or when only Oracle Database 9.2 client libraries are available.

  • oci_set_*($connection, ...) meta data setting call error handling is fixed so that oci_error($connection) works for these calls.

Note: The old, deprecated function aliases like ocilogon still exist but are not recommended for new applications.

Phpinfo() Changes

Some cosmetic changes were made to the output of php --ri oci8 and the phpinfo() function.

  • The oci8.event and oci8.connection_class values are now shown only when the Oracle client libraries support the respective functionality.

  • Connection statistics are now in a separate phpinfo() table.

  • Temporary LOB and Collection support status lines in phpinfo() output were removed. These two features have always been enabled since 2007.

Oci_internal_debug() Changes

  • The oci_internal_debug() function is now a no-op. Use PHP's --enable-dtrace functionality with DTrace or SystemTap instead.

References

Thursday Jul 25, 2013

PHP OCI8 2.0.0-devel for Oracle Database is on PECL

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:

    - NEW FUNCTIONALITY:
 
      - 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

    - IMPROVED FUNCTIONALITY:
 
      - 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.
 
    - CHANGED FUNCTIONALITY:
 
      - PHPINFO() CHANGES:
 
        - The oci8.event and oci8.connection_class values are now shown
          only when the Oracle client libraries support the respective
          functionality.
 
        - 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.
 
      - OCI_INTERNAL_DEBUG() CHANGES:
 
        - The oci_internal_debug() function is now a no-op.  Use PHP's
          --enable-dtrace functionality with DTrace or SystemTap instead.
 
    - INTERNAL CHANGES:
 
      - 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
        prototypes.
 
      - Fixed code folding. 

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

Tuesday Mar 13, 2012

PHP 5.4.0 RPMs for 64bit Oracle Linux 5.x are available

I've published some vanilla PHP 5.4.0 RPMs to make new feature testing easier for Oracle Linux 5.x 64 bit users. The standard set of RPMs is at oss.oracle.com/projects/php. The OCI8 extension is also available (this requires the free Oracle Instant Client 11.2 from ULN or OTN.)

Some of the features of PHP 5.4 are:

  • Improved memory usage and performance. Some impressive preliminary reports of the benefits include: http://news.php.net/php.internals/57760 and http://news.php.net/php.internals/57747.

  • File Upload progress support is natively implemented.

  • Support for Traits now allows code reuse:

        trait t1 {
    	function m1() { echo "hi"; }
    	function m2() { echo "bye"; }
        }
    
        class my_c1 {
    	use t1;
    	/*...*/
        }
    
        class my_c2 extends c2 {
    	use t1;
    	/*...*/
        }
    
  • A built-in HTTP server for development is included:

      php -S 127.0.0.1:8888
    
  • Improvements were made to the interactive PHP shell (when PHP is compiled with readline).

  • A shortened array syntax was introduced: $a = [1,2,3];

  • The default character set for several internal functions was changed to UTF-8.

  • Support for multibyte languages is now configurable at run-time instead of compile-time.

  • The value echo tag "<?=" is now always on.

  • Binary number support was added.

  • DTrace support was added.

  • A new typehint indicates a function argument must be callable.

  • Session entropy uses /dev/urandom or /dev/arandom by default for extra security if either is present at compile time.

  • Function call results can now be immediately dereferenced as arrays: foo()[0]

  • Class members can be accessed on instantiation: (new foo)->method()

For more changes see the migration documentation.

Thursday Jan 12, 2012

PHP 5.3.9 RPMs Available for Testing

I've updated my relatively "vanilla" PHP 5 RPMs to 5.3.9 on oss.oracle.com/projects/php. They are built for Oracle Linux 5.7 (and RHEL 5.7). I've included the OCI8 extension for Oracle DB, of course. The various MySQL extension are there and use the mysqlnd driver, so installation doesn't require any client-side MySQL libraries. Note the PHP 5.3.9 RPMs are for testing only. For production users I recommend Zend Server.

Wednesday Jan 11, 2012

PHP OCI8 1.4.7 is available on PECL

Following on the heels of the PHP 5.3.9 release, I've bundled OCI8 1.4.7 for PECL. The PECL OCI8 1.4.7 code is the same as included in PHP 5.3.9 and can be used to update older PHP installations. The release notes are here. There are several bug fixes; upgrading is recommended.

Saturday Sep 03, 2011

Oracle 11.2 XE with newly updated PHP Developer's Guide is available

Oracle Database 11g Release 2 Express Edition aka "Oracle XE" is now available on Linux 64 bit and Windows 32 bit. This is a free version of the Oracle Database. Windows 64 bit is "in the works" but Linux 32 bit is not planned.

Check out the newly updated Oracle Database Express Edition 2 Day + PHP Developer's Guide. As well as HTML and PDF variants, the manual is available in Mobi and EPUB formats.

The 2 Day + PHP manual has steps for installing PHP and walks through creating an introductory application. It shows different ways to interact with Oracle XE and introduces PHP 5.3 features.

The example shows the mechanics of DB interaction. It builds the application from the ground up so you can understand how to construct your own high performance applications. If you want to continue the learning path and use a PHP framework, Oracle 11g XE works with the Developing a PHP Web Application with Oracle Database 11g training.

The Oracle 11.2 XE Linux install is RPM based. It takes just a few minutes to install, prompting only for a few necessary details such as desired passwords and ports. You need root access to install it.

Oracle 11.2 XE supports DRCP connection pooling so you'll really be able to maximize the small footprint database for PHP applications.

Readers who want to dive deeper into detail about PHP and advanced features available in other editions of Oracle Database might be interested in the later sections of the Underground PHP and Oracle Manual.

Wednesday May 11, 2011

PHP 5.4 is Gathering Momentum

Discussion on the PHP mail lists and IRC channels in the past few days has been looking positive about an alpha release of PHP 5.4 soon. This will be taken from the "trunk" branch of PHP. The exact feature list is under discussion but the mood seems to be "ship what we currently have" though a couple of features are slated to be deferred until later.

A paragraph from a post by Rasmus Lerdorf on PHP's "internals" mail list is worth re-broadcasting. Rasmus is more than willing to grant PHP karma to encourage contributions:

And if you can't figure out how to fix a test, post the details here. I'd love to point some of the obvious talents and energy of this list towards the code. If you don't have an svn account for committing your fixed test, go to http://www.php.net/svn-php.php and fill in the little form at the bottom there and put in the test that you fixed and a 1-liner about how you fixed it and I will set you up with an account right away. Info on how to check out the code from svn is here: https://wiki.php.net/vcs/svnfaq

So, you can easily become a contributor to PHP, which would look great on your resume.

If SVN seems daunting you can run PHP tests from the normal snapshots and release bundles too.

To discuss test issues you can subscribe to the PHP internals and QA mail lists at http://php.net/mailing-lists.php

Friday Apr 01, 2011

Oracle 11gR2 XE Beta is now available

[Read More]

Tuesday Mar 29, 2011

cx_Oracle 5.1 for Python is Available

[Read More]

Thursday Dec 09, 2010

PHP OCI8 1.4.5 is on PECL

[Read More]

Wednesday Nov 10, 2010

PECL OCI8 1.4.4 is Available

[Read More]

Saturday Sep 18, 2010

Newly Released Stuff: Perl Driver, Python Tools and Berkeley DB 5.1

[Read More]

Wednesday Sep 15, 2010

Oracle Database and Instant Client 11.2.0.2 are available on Linux

[Read More]

Monday Aug 09, 2010

PHP OCI8 1.4.3 is Available on PECL

[Read More]

Tuesday Oct 06, 2009

PHP OCI8 1.4.0 Alpha is now available

[Read More]
About

Tourists looking out over an Opal mine
I'm a Product Manager in Server Technologies, working on scripting languages and developer-access.
Email: christopher.jones@oracle.com
Twitter: http://twitter.com/ghrd
Book: Free PHP Oracle book
Download: PHP Linux RPMs with the OCI8 extension
Links: OTN PHP Developer Center

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today