PHP支持OCI8扩展

上一篇 / 下一篇  2010-09-02 13:27:53 / 个人分类:配置管理

Oci8扩展51Testing软件测试网J/bey T2z,? ^

1、    下载oracel客户端安装文件51Testing软件测试网g)@}1C%BV \"Q

51Testing软件测试网NPT%kh,] q t

http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html oracle-instantclient-basic-10.2.0.4-1.i386.rpm51Testing软件测试网/a1d1Kq3e$w

51Testing软件测试网R@;s Ksu {

oracle-instantclient-devel-10.2.0.4-1.i386.rpm51Testing软件测试网8G|z!p? w

up*?'t d1N0oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm51Testing软件测试网k g,NKU E%X

51Testing软件测试网}H8G)VV(R&U/PT

 51Testing软件测试网 TAc r2y0f?v

51Testing软件测试网A6pSw f

2、    安装及客户端模块加载

dD1u3v'U ADR051Testing软件测试网8Il:B^LV.t\%F!Ql

rpm -ivh oracle-instantclient-basic-10.2.0.4-1.i386.rpm

i-US y(N]6~051Testing软件测试网(A8cc1_p8I

rpm -ivh oracle-instantclient- devel -10.2.0.4-1.i386.rpm51Testing软件测试网/rEpj8r1Kv

51Testing软件测试网1l Nr^2j$n}

rpm -ivh oracle-instantclient- sqlplus -10.2.0.4-1.i386.rpm

-?K#mA!@.O0

E4ni+ZcxGgU0 51Testing软件测试网7r&K:x!Y Gws0nO7\

51Testing软件测试网}[Vf3h#H'n-]#k5]y

echo "/usr/include/oracle/10.2.0.4/client/" >/etc/ld.so.conf.d/oracle_client.conf

zM0mk#|6D`0D051Testing软件测试网s)mB S)r^ W4}

 

`I,DH}/|0h6_y0

i _D y)?1u0/sbin/ldconfig

[`1q _fqb#A0

4OaeF({b7o:H;VU:`0 51Testing软件测试网5tn;W2DJ

g,A*K ivY|9a] Bq03、    安装OCI8 PHP扩展51Testing软件测试网 xq[v$^;~ L&S

v-u!B,`'@hv0可以用PHP自带的oci8( php-5.3.0/ext/oci8)

7l7A]K&Q.bn;S0

(R4{^6l.C!n0可以下载:51Testing软件测试网6o,e8_PC#R(a

51Testing软件测试网C%f*Ru-I6lgW

http://pecl.php.net/get/oci8-1.3.5.tgz

wWSq[FQ]0

c _Rtj7\SZ0         tar zxvf oci8-1.3.5.tgz

y3ZN)yO0

Rs Ysah)S9}0cd oci8-1.3.5/

O&P??ygt051Testing软件测试网 m^s4kE

执行:51Testing软件测试网_(@WLiSjwZr

51Testing软件测试网 l"M/} N1d

/usr/local/php5/bin/phpize51Testing软件测试网Y(K)L dd$\?\*L

tII:cDx j6n0CFLAGS="-I/usr/include/oracle/10.2.0.4/client/"

1pd)Vp)e(A9m@0

-?+E0C6pH R$^pmQ%lO$U0CXXFLAGS="-I/usr/include/oracle/10.2.0.4/client/"51Testing软件测试网4Z'f}#IvM

51Testing软件测试网d6lwD*vO3K.vl:Sm

./configure --with-php-config=/usr/local/php5/bin/php-config --with-oci8=share,instantclient,/usr/lib/oracle/10.2.0.4/client/lib/51Testing软件测试网\P[/Si

,cAwx^aS%Nk0make51Testing软件测试网7cuZh;x2R+xqkY

51Testing软件测试网bw4Ekc

make install

|K/dmS5CO;c C0

*].EL)Tk0 51Testing软件测试网 XPvh6F9nL&D/Q

2v@4m:r1on/k0其实在上面出现Permission denied时,也可以执行

(Mz#BiG/yXU051Testing软件测试网`5E ]6i(YGzzK

#chcon -t texrel_shlib_t /usr/lib/oracle/10.2.0.4/client/libnnz10.so51Testing软件测试网!|8E5x6N7h

51Testing软件测试网|6P3xBe%w

 51Testing软件测试网 Y7t"T9l `?cZ

51Testing软件测试网 TP4p'sZ[#tN/{;r l i

修改PHP配置文件(/usr/local/lib/php.ini)

(k;t9}!I DFzP051Testing软件测试网t*}1fv*l X C+Em5d

添加:51Testing软件测试网u W)g&L t-`E~k

51Testing软件测试网 fH$|V$N

extension_dir = "/usr/local/php5/lib/php/extensions/no-debug-zts-20090626/"

,FwI3d&@ qI3\0

!n)NP ]oJU0extension = "oci8.so"51Testing软件测试网zO]'R&V

51Testing软件测试网3Dt^L$O(B

重启apache2

#u:P1O%@`3Q5O051Testing软件测试网\o.WJ5}e/T

打开PHP测试页,看OCI8是否配置上,如果没有,可以重新编译PHP,在原来的配置里加入--with-oci8 再重新编译。51Testing软件测试网 n.@4X Y'T Z8{[5b


TAG:

 

评分:0

我来说两句

Open Toolbar