1

oracle database connectivity issue in php with oci_connect function is undefined on linux centOs 7 follows this article too. Centos 6 PHP OCI8 extention is not working (Undefined function oci_connect())

Not found perfect solution for this.

Community
  • 1
  • 1
hussain arif
  • 11
  • 1
  • 2

1 Answers1

2

You need install [OCI8] extension in php.ini:

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

Now enable extension in php.ini

cd /etc/php.ini

And do to the following line:

[OCI8]

and enable extension:

;extension=oci8.so

to

extension=oci8.so

And restart server service:

service apache2 restart

or

service httpd restart

You have oci_connect () defined.

ihojose
  • 312
  • 2
  • 12
  • Thanks for your reply @ihojose I will try and let you know. – hussain arif Mar 23 '16 at 08:49
  • @ihojose I am facing the same error but I am using rhel 7.9. These instructions will work for me? please look into this link https://stackoverflow.com/questions/69360325/no-releases-available-for-package-pecl-php-net-oci8 – ratna Oct 28 '21 at 10:43