Centos x64 7 下 Oracle 扩展配置
ps:例子是php71.安装oracle组件
下载:http://www.oracle.com/technetwor ... -64soft-092277.html
注册账号:**** Hidden Message *****
oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
PS: 两个都必须安装,devel版本就是SDK
2.安装
rpm -i oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
rpm -i oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm
软连接下
ln -s /usr/lib/oracle/12.2 /usr/lib/oracle/10.2.0.1
ln -s /usr/include/oracle/12.2 /usr/include/oracle/10.2.0.1
3.添加配置项目
vi /etc/profile
最后加入:
export ORACLE_HOME=/usr/lib/oracle/12.2/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
export NLS_LANG="AMERICAN_AMERICA.AL32UTF8" //具体字符集根据服务端来
执行生效:
source /etc/profile
3.编译安装oci8
下载:http://pecl.php.net/package/oci8
wget http://pecl.php.net/get/oci8-2.1.8.tgz
解压安装
tar -zxf oci8-2.1.8.tgz
cd oci8-2.1.8
/www/server/php/70/bin/phpize
./configure --with-php-config=/www/server/php/70/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/12.2/client64/lib
make
make install
备注:phpize和php-config 根据实际php安装路径来哦
4.编译安装pdo_oci
升级re2c 不升级有警告错误
yum -y install re2c
下载php源码包
wget https://www.php.net/distributions/php-7.0.33.tar.gz
解压并进入pdo_oci目录
tar -zvxf php-7.0.33.tar.gz
cd php-7.0.33/ext/pdo_oci/
phpize
./configure --with-php-config=/www/server/php/70/bin/php-config --with-pdo-oci=instantclient,/usr,10.2.0.1
make
make install
php-config 根据实际php安装路径来哦
5.php.ini添加扩展
extension=oci8.so
extension=pdo_oci.so
6.重启php 看探针 有了 完成
页:
[1]