Oci_connect function is undefined in CentOS with Oracle

巧了我就是萌 提交于 2019-12-12 03:25:22

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/36157196/oci-connect-function-is-undefined-in-centos-with-oracle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!