[英]Oci_connect function is undefined in CentOS with Oracle
oracle database connectivity issue in php with oci_connect function is undefined on linux centOs 7 follows this article too. 在php中,带有oci_connect函数的oracle数据库连接问题在linux centOs 7上也是未定义的。 Centos 6 PHP OCI8 extention is not working (Undefined function oci_connect())
Centos 6 PHP OCI8扩展无法正常工作(未定义函数oci_connect())
Not found perfect solution for this. 找不到完美的解决方案。
You need install [OCI8] extension in php.ini: 您需要在php.ini中安装[OCI8]扩展名:
Install both RPM packages: 安装两个RPM软件包:
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: 下载OCI8扩展:
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): 使用您的Oracle客户端库路径配置扩展(使用您自己的版本更改路径…/ 11.2 /…):
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib/
Compile and install: 编译安装:
make
make install
Now enable extension in php.ini 现在在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. 您已定义oci_connect()。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.