centos上对php安装oci8扩展的支持

1.先像上一篇文章描述的那样安装好oracle client

2.对php增加oci8拓展

(1)用pecl安装oci拓展

pecl install oci8

一路自动编译下去之后,突然卡在这个地方报错了

checking Oracle Instant Client SDK header directory... configure: error: Oracle Instant Client SDK header files not found
ERROR: `/var/tmp/oci8/configure --with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib' failed

 

缺少SDK就去官网下SDK呗,于是又到官网地址 http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

找到以下内容的sdk devel rpm包

*Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
Download oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm (609,139 bytes) (cksum - 2701969031)

使用 

rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm

进行默认的安装即可

 

重新执行 pecl install oci8

出现如下提示则代表安装扩展的过程完全成功,如出现其他提示,请返回重做上面的步骤

Build process completed successfully
Installing '/usr/lib64/php/modules/oci8.so'
install ok: channel://pecl.php.net/oci8-1.4.9
configuration option "php_ini" is not set to php.ini location
You should add "extension=oci8.so" to php.ini

 

 

(2)对php.ini进行设置,php.ini文件底部增加oci8.so

[oracle oci8]
extension=oci8.so

然后使用 service php-fpm restart重启php之后,查看phpinfo可见oci8成功开启,设置全部完成.

发表评论

电子邮件地址不会被公开。 必填项已用*标注