> 数据库 > Oracle >

PHP 安装64位oracle客户端

1、下载Oracle即时客户端程序包 — Basic: 运行 OCI、OCCI 和 JDBC-OCI 应用程序所需的所有文件

  1. wget http://www.freebsdsystem.org/nginx_php/oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm   
  2. wget http://www.freebsdsystem.org/nginx_php/oracle-instantclient11.2-devel-11.2.0.2.0.x86_64.rpm  
  3. wget http://www.freebsdsystem.org/nginx_php/oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm  

2、安装Oracle即时客户端程序包


			
  1. rpm -ivh oracle-instantclient11.2-*  
  2.  
  3. echo "/usr/lib/oracle/11.2/client64/lib/" > /etc/ld.so.conf.d/oracle_client.conf  
  4. /sbin/ldconfig  
  5.  

3、安装OCI8 PHP扩展(使用PHP自带的OCI8,假设PHP程序安装在/usr/local/php52/)


			
  1. yum install libaio  
  2. wget http://pecl.php.net/get/oci8-1.4.5.tgz  
  3. tar zxvf oci8-1.4.5.tgz  
  4. cd oci8-1.4.5/  
  5. /usr/local/php52/bin/phpize  
  6. CFLAGS="-I/usr/include/oracle/11.2/client64/" 
  7. CXXFLAGS="-I/usr/include/oracle/11.2/client64/" 
  8. ./configure –with-php-config=/usr/local/php52/bin/php-config –with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib  
  9. make  
  10. make install  

 

4、修改PHP配置文件(/usr/local/php52/etc/php.ini)

 

在extension_dir = "/usr/local/php52/lib/php/extensions/no-debug-non-zts-20060613/"后增加一行:

extension = "oci8.so"

 

5、重启php-fpm

/usr/local/php52/sbin/php-fpm reload

 


(责任编辑:IT)