danny 2008-4-22 11:22
php-oci8 on centos5
小丹尼的同事突然來找我說要裝php-oci8,由於太久沒裝了所以也忘了差不多,所幸Google大神幫了大忙,看了網路上的文章再加上一點修正順利的裝好這個鳥元件~~
環境: CentOS5 i386
[code]# wget http://ftp.freshrpms.net/pub/freshrpms/redhat/testing/EL5/oracle/SRPMS/oracle-instantclient-10.2.0.3-1.nosrc.rpm
# rpm -ivh oracle-instantclient-10.2.0.3-1.nosrc.rpm
# wget ftp://fr.rpmfind.net/linux/fedora/development/i386/os/Packages/compat-libstdc++-33-3.2.3-63.i386.rpm
# rpm -ivh compat-libstdc++-33-3.2.3-63.i386.rpm[/code]取得[url]http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html[/url] 底下的
instantclient-basic-linux32-10.2.0.3-20061115.zip
instantclient-jdbc-linux32-10.2.0.3-20061115.zip
instantclient-odbc-linux32-10.2.0.3-20061115.zip
instantclient-sdk-linux32-10.2.0.3-20061115.zip
instantclient-sqlplus-linux32-10.2.0.3-20061115.zip
將上述檔案放到 /usr/src/redhat/SOURCES
然後開始編繹了[code]# cd /usr/src/redhat
# rpmbuild -ba SPECS/oracle-instantclient.spec [/code]接下來把編出來的東西都裝一裝。unixODBC 一般人不會裝到, 所以列在下面免得漏掉[code]# yum install unixODBC.i386
# cd /usr/src/redhat/RPMS
# for i in *.rpm; do rpm -hiv ${i}; done[/code][code]# wget http://ftp.freshrpms.net/pub/freshrpms/redhat/testing/EL5/oracle/i386/php-oci8-5.1.6-1.el5.i386.rpm
# rpm -ivh http://ftp.freshrpms.net/pub/freshrpms/redhat/testing/EL5/oracle/i386/php-oci8-5.1.6-1.el5.i386.rpm
# ldconfig
(refresh cache. 好像不用? 管它, 有拜有保佑)[/code]接下來就是重啟 apache[code]# service httpd restart[/code]開 phpinfo 去看, 應當可以看到 oci8 在裡面了。
參考來源:
http://blog.bsdchat.com/2007/08/php-oci8-on-centos5.html