HOME | linux | centos上安裝oci8

centos上安裝oci8

2015/09/17/11:35 , Post in linux , 評論(0) , 引用(0) , 閱讀(1006) , Via 本站原創
Oracle的連線真的是一件無比麻煩的事,要裝一堆Instant Client什麼鬼的

首先到sun下載並安裝oracle的library

oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
oracle-instantclient11.2-odbc-11.2.0.3.0-1.x86_64.rpm

但是如果只是php要連oracle db的話,接著安裝oci8就可以了

首先用pear下載oci8檔案

pear download pecl/oci8

tar -xvf oci8-2.0.8.tgz   #接著解壓縮

cd oci8-2.0.8

phpize

./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib   #configure

make install

這樣就安裝完成了,接著修改php的設定檔

vim /etc/php.ini

extension=oci8.so  #設定檔中加上這行

到這邊應該就可以運作了

vim /etc/php.d/oci8.ini   #額外的設定,我也看不懂,就照抄吧

oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20



發表評論

暱稱

網址

電郵

開啟HTML 開啟UBB 開啟表情 隱藏 記住我 [登入] [註冊]