1

On a CentOS 7 server, I have installed PHP from remi repository. I need to connect to Oracle 9.2 on a remote machine. Installing oci8 via yum install oci8 results OCI8 Version 2.1.0 which is not compatible with Oracle 9.2. The following is from the phpinfo output.

OCI8 Support    enabled
OCI8 DTrace Support enabled
OCI8 Version    2.1.0
Revision    $Id: 8e84657b6fdeaa913819689ef327ad2808110ed4 $
Oracle Run-time Client Library Version  12.1.0.2.0
Oracle Compile-time Instant Client Version  12.1

Trying to install an earlier version using pecl install oci8-1.4.10 fails as well:

In file included from /var/tmp/oci8/oci8.c:58:0:
/var/tmp/oci8/php_oci8_int.h:56:17: fatal error: oci.h: No such file or directory
 #include <oci.h>
                 ^
compilation terminated.
make: *** [oci8.lo] Error 1
ERROR: `make' failed

What should I do to install oci8 version 1.*?

1 Answer 1

1

Have you tried these steps yet?:

Install both RPM packages :

rpm -ivh instantclient-basic-linux.XXX.rpm
rpm -ivh instantclient-sdk-linux.XXX.rpm

Install some prerequisite

yum install php-pear yum install php-devel

Download the OCI8 extension

pear download pecl/oci8 
tar xvzf oci8-1.4.7.tgz 
cd oci8-1.4.7/phpize

Configure the extension with your Oracle client library path (change the path …/11.2/… with your own version) :

./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/

Compile and install

make 
make install

Configure SELinux : allows httpd to execute programs that require memory addresses that are both executable and writeable

setsebool -P httpd_execmem 1

Add the folowing configuration at the end of php.ini

vi /etc/php.ini
[OCI8] extension=oci8.so

Restart Apache

service httpd restart

Source: http://antoine.hordez.fr/2012/09/30/howto-install-oracle-oci8-on-rhel-centos-fedora/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .