PHP Oracle Extensions

Posted by Whiz
There are various ways PHP can connect to Oracle. Although this book concentrates on the
OCI8 extension for PHP, it is worth knowing the alternative libraries and extensions you can
use.

Choosing a PHP Oracle Extension

Several PHP extensions provide PHP functions for accessing Oracle databases and there are
also database abstraction layers written in PHP which are popular. You can also use the
ODBC extension.
If you want to make full use of Oracle features and want high performance use PHP’s
main Oracle extension, the OCI8 extension. If you want database independence, consider
using the PHP Data Object (PDO) extension or ADOdb. For basic database operations your
PHP application will work with different database vendors simply by changing the extension
driver.
Basic database access in each extension and abstraction library is very similar. The
differences are in their support for advanced features and the programming methodology
promoted.

PHP Oracle Extensions

The PHP Oracle extensions can be compiled into the PHP binary. The extensions are:
* Oracle
* OCI8
* PDO
They are all included in the PHP source code with PHP’s open source license.
Oracle Extension
The extension called “Oracle” was included in PHP 3, 4 and 5.0. It had limited functionality,
is no longer in PHP and is not maintained. This extension accessed the database using
Oracle’s obsolete C code OCI7 API. New development using this extension is not
recommended.

OCI8 Extension

The OCI8 extension is included in PHP 3, 4, and 5. It is also in PHP 6, which is in the early
stage of development.
For PHP 5.1.2, OCI8 was refactored by Zend and Oracle to increase stability and
performance, and released as open source. The PHP interfaces are the same as the original
OCI8 extension but there are new connection management and performance settings.

0 Response to 'PHP Oracle Extensions'

Post a Comment