apache php oci8,linux下,给php增加oci8模块

每次安装oci8 总是出现各种各样的问题. 所以在这里做一个笔记,方便自己安装,也方便各位需要的朋友参考使用.

闲话少说 直接操作

1. 根据实际情况选择版本,下载oracle客户端压缩包和sdk压缩包

http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html

以下为 10.0.2 为例

2. 将client和sdk解压到同一个目录并放到操作系统的一个指定目录 比如 /soft/instantclient_10_2

3. 执行如下命令,将oracle环境变量加入到 profile

cat >>/etc/profile<<EOF

#_php_oci_instantclient

export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'

export PATH=\$PATH:/soft/instantclient_10_2

export TNS_ADMIN=/soft/instantclient_10_2

export LD_LIBRARY_PATH=/soft/instantclient_10_2

export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"

export ORACLE_HOME=/soft/instantclient_10_2

EOF

4. 执行如下命令 ,修改 oracle_client so文件权限,修改上下文安全

chcon -t texrel_shlib_t /data/soft/instantclient_10_2/*.so

chcon -t texrel_shlib_t /data/soft/instantclient_10_2/*.so.*

5. 读取环境变量信息

source /etc/profile

6. 下载 oci8的压缩包 并进行编译

http://pecl.php.net/package/oci8

# 指定php变量 或者在with-php-config 位置替换变量,指定 php-config目录

PHP_DIR=php的安装目录

tar zxvf oci8-2.0.8.tar.gz

cd oci8-2.0.8

phpize

./configure \

--with-php-config=${PHP_DIR:?NULL}/bin/php-config \

--with-oci8=shared,instantclient,${ORACLE_HOME:?NULL}

make

make install

7. 修改 php.ini文件 增加

extension = “oci8.so”

8. 根据实际情况, 重启 php 或者 apache

最后编辑:2014-11-19作者:王, 帅

5263f3f951d19f4738b200769c1ebf52?s=96&d=mm&r=g

这个作者貌似有点懒,什么都没有留下。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值