在带有Oracle的CentOS中未定义Oci_connect函数 [英] Oci_connect function is undefined in CentOS with Oracle

查看:90
本文介绍了在带有Oracle的CentOS中未定义Oci_connect函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

oracle数据库连接问题 也遵循本文. Centos 6 PHP OCI8扩展无法正常工作(未定义函数oci_connect())

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.

推荐答案

您需要在php.ini中安装[OCI8]扩展名:

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

安装两个RPM软件包:

Install both RPM packages:

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

安装一些先决条件:

yum install php-pear
yum install php-devel

下载OCI8扩展名:

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

使用您的Oracle客户端库路径配置扩展(使用您自己的版本更改路径…/11.2/…):

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/

编译并安装:

make
make install

现在在php.ini中启用扩展名

Now enable extension in php.ini

cd /etc/php.ini

然后执行以下行:

[OCI8]

并启用扩展名:

;extension=oci8.so

extension=oci8.so

并重新启动服务器服务:

And restart server service:

service apache2 restart

service httpd restart

您已定义oci_connect().

You have oci_connect () defined.

这篇关于在带有Oracle的CentOS中未定义Oci_connect函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆