Requirements
The OCI8 1.4 extension is included with PHP 5.3, PHP 5.4 and PHP 5.5. It is also available from » PECL. A newer OCI8 2.0 version is available only from » PECL. OCI8 1.4 requires Oracle 12c, 11g, 10g or 9iR2 client libraries and will install on PHP 4.3.9 onwards. OCI8 2.0 requires Oracle 12c, 11g or 10g client libraries and will install on PHP 5.2 onwards.
If the Oracle Database is on the same machine as PHP, the database software already contains the necessary libraries. When PHP is on a different machine, use the free » Oracle Instant Client libraries.
To use Oracle Instant Client, install the basic or basiclite Oracle Instant Client ZIP file or RPM package. When building PHP from source code, also install the sdk ZIP file or devel RPM package.
You must run PHP with the same, or a more recent, version of the Oracle libraries that OCI8 was built with.
On Windows, the php_oci8 DLL needs Oracle client libraries from version 10gR2 or greater. In PHP 5.3 up to and including PHP 5.3.5, the php_oci8_11g DLL requires Oracle 11gR1 or greater client libraries. From PHP 5.3.6 the php_oci8_11g DLL requires Oracle 11gR2 or greater client libraries. The php_oci8_12c DLL from PECL requires Oracle 12cR1 client libraries. With some versions of Instant Client you may additionally need mfc71.dll and msvcr71.dll libraries.
Note:
If OCI8 uses 9iR2 client libraries, then PHP can connect to Oracle Database 8i, 9iR2, 10g or 11g. If OCI8 uses 10gR2 client libraries, the database can be 9iR2, 10g, 11g or 12c. If OCI8 uses 11g client libraries, the database can be 9iR2, 10g, 11g or 12c. If OCI8 uses 12c client libraries, the database can be 10gR2, 11g or 12c.
Note:
Full OCI8 feature support is only available when using the most recent versions of the Oracle client libraries and database.
Коментарии
Oracle Instant Client provides its own LDAP library that may be incompatible to the LDAP library provided by the operating system.
Segmentation faults and other errors can happen if you load an OCI8 extension into a PHP containing LDAP support or if you load a PHP module with OCI8 into an Apache server with LDAP support.
But this depends heavily on the exact versions of operating system, system LDAP library, PHP, OCI8, and other pieces of software involved.
I can confirm Rainer's observations and this not limited to PHP. One cannot link libopenldap with C with Oracle driver without crashing the app at runtime. Same here on HP-UX. Both won't play nice at all.
The provided link to the Oracle Instant Client is not valid anymore. Visit http://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html instead.
Oracle's development package includes an ldap.h file that causes compilation attempts of PHP to fail.
For the oracle-instantclient12.2-devel 64-bit RPM, this file is found in the following path:
/usr/include/oracle/12.2/client64/ldap.h
Rename this file to ldap.h-oracle.
After doing so, and assuming there are no other build problems, PHP will compile (even when ldap and oci are configured in the build).
The OCI8 extension lets you access Oracle Database.
Use 'pecl install oci8' to install for PHP 8.1.
Use 'pecl install oci8-3.0.1' to install for PHP 8.0.
Use 'pecl install oci8-2.2.0' to install for PHP 7.
Use 'pecl install oci8-2.0.12' to install for PHP 5.2 - PHP 5.6.
Use 'pecl install oci8-1.4.10' to install for PHP 4.3.9 - PHP 5.1.
[username@hostname ~]# php -v
^ To see PHP version