How to configure OCI to connect to Oracle with PHP?

In the latest Ubuntu, I have a live installation of PHP 5.2.4. I want to use a remote Oracle server from PHP using OCI.

I downloaded the "Instant Client Package - Basic Lite" ( Link ). I unpacked the package containing the OCI libraries into a directory, but I don’t know how to tell PHP that I want to use these libraries. As expected, I get

Fatal error: call to undefined oci_connect () in ...

when running this code:

<?php 
   $conn = oci_connect('hr', 'hrpw', 'someremotehost');
?>

I do not want to recompile PHP with Oracle support. What is the fastest way to enable PHP so I can use Oracle? Do I need any other libraries, such as an Oracle client, if I want to connect to a remote instance of Oracle?

+3
3

PHP, Ubuntu:

(sudo) pecl install oci8

, php.ini( Apache cli php) extension=oci8.so . , Apache <?php phpinfo(); ?>, .

UPDATE:

- , ORACLE_HOME:

instantclient,///instantclient

, . /opt/oracle... , instantclient. , , .

+4

, , $ORACLE_HOME/lib32 $LD_LIBRARY_PATH /etc/ld.so.conf.

0
0

Source: https://habr.com/ru/post/1698733/


All Articles