首页  >  文章  >  数据库  >  PHP安装Oracle扩展[重新整理]

PHP安装Oracle扩展[重新整理]

WBOY
WBOY原创
2016-06-07 16:40:291209浏览

环境 System:CentOS 6 PHP: 5.3.28 下载Oracle客户端 32位系统 64位系统 oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpmoracle-instantclient-jdbc-10.2.0.4-1.x86_64.rpmoracle-instantclient-devel-10.2.0.4-1.x86_64.rpmoracle-instantclient-basi

环境

System:CentOS 6
PHP: 5.3.28

下载Oracle客户端

32位系统
64位系统

<code>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
</code>

执行安装:

<code># rpm -ivh *.rpm
</code>

下载Oracle的PHP扩展

官方下载

<code>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
</code>

更改php.ini

<code># vi /usr/local/php/etc/php.ini
</code>

增加 extension = "oci8.so"

重新启动PHP

<code>ps aux | grep php | grep root
kill -USER2 php_root_pid
</code>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn