Home  >  Article  >  php教程  >  CentOS下PHP安装Oracle扩展

CentOS下PHP安装Oracle扩展

WBOY
WBOYOriginal
2016-06-13 09:14:311052browse

CentOS下PHP安装Oracle扩展

这篇文章主要介绍了CentOS下PHP安装Oracle扩展,本文讲解了环境、下载Oracle客户端、更改php.ini、重新启动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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn