CentOS下PHP安装Oracle扩展

yipeiwu_com6年前PHP代码库

环境

System:CentOS 6
PHP: 5.3.28

下载Oracle客户端

32位系统

64位系统

复制代码 代码如下:

oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm
oracle-instantclient-jdbc-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm
oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm

执行安装:

复制代码 代码如下:

# rpm -ivh *.rpm

下载Oracle的PHP扩展

官方下载

复制代码 代码如下:

wget http://pecl.php.net/get/oci8-2.0.7.tgz
# tar zxvf oci8-2.0.7.tgz
# cd oci8-2.0.7
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.4/client64/lib/
# make && make install

更改php.ini
复制代码 代码如下:

# vi /usr/local/php/etc/php.ini

增加 extension = "oci8.so"

重新启动PHP

复制代码 代码如下:

ps aux | grep php | grep root
kill -USER2 php_root_pid

相关文章

自制PHP框架之设计模式

为什么要使用设计模式? 设计模式,我的理解是为了达到“可复用”这个目标,而设计的一套相互协作的类。 感兴趣的读者可以阅读《Design Patterns: Elements of Reu...

浅析php过滤html字符串,防止SQL注入的方法

批量过滤post,get敏感数据复制代码 代码如下:$_GET = stripslashes_array($_GET);$_POST = stripslashes_array($_POS...

PHP系统命令函数使用分析

复制代码 代码如下:function execute($cmd) {     $res = '';    ...

php url地址栏传中文乱码解决方法集合

php地址栏传中文$_GET下来后乱码,urlencode和urldecode用法详解url编码语法: string urlencode(string str);返回值: 字符串函数种类...

PHP将进程作为守护进程的方法

本文实例讲述了PHP将进程作为守护进程的方法。分享给大家供大家参考。具体分析如下: php中posix_setsid()的用法 文档解释是“Make the current proces...