Требования

Модуль OCI8 3.0 включён в PHP 8. Также он доступен в » PECL. Для PHP 7, используйте OCI8 2.2 from » PECL. Для работы OCI8 требуются клиентские библиотеки Oracle 10g или выше.

Если база данных Oracle находится на той же машине, что и PHP, то все необходимые библиотеки и заголовочные файлы уже установлены. Если PHP установлен на другую машину, то используйте бесплатные библиотеки с » Oracle Instant Client.

Для использования Oracle Instant Client, установите Basic или Basic Lite zip-архив Oracle Instant Client или RPM или DMG пакет. При сборке PHP из исходного кода, также установите Instant Client SDK.

Необходимо использовать PHP с теми же или более свежими версиями библиотек Oracle, чем те, с которыми был собран модуль OCI8.

Замечание:

Принципы клиент-серверной сетевой совместимости Oracle, позволяют создавать соединения между различающимися версиями Oracle Client и Oracle Database. Подробности смотрите в документе совместимости ID 207303.1. В кратце, Oracle Client 19, 18 и 12.2 могут соединяться с Oracle Database 11.2 и выше. Oracle Client 12.1 может соединяться с Oracle Database 10.2 и выше. Oracle Client 11.2 может соединяться с Oracle Database 9.2 и выше.

Замечание:

Полный набор возможностей OCI8 возможен только при использовании новейших версий клиентских библиотек Oracle и базы данных.

add a note

User Contributed Notes 5 notes

up
5
Wilber
1 year ago
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
up
4
Andi,post at rueckauer dot nospam dot ch
5 years ago
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.
up
3
Rainer Perske
6 years ago
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.
up
0
charles dot fisher at arconic dot com
4 years ago
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).
up
0
sgfan at gmx dot net
6 years ago
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.
To Top