[文章作者:张宴 本文版本:v1.0 最后修改:2009.04.21 转载请注明原文链接:http://blog.zyan.cc/post/411/]
1、下载Oracle即时客户端程序包 — Basic: 运行 OCI、OCCI 和 JDBC-OCI 应用程序所需的所有文件
①、打开以下网址(本文以32位版为例):
(Linux 32位版)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
(Linux 64位版)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html
②、下载以下几个文件:
2、安装Oracle即时客户端程序包
3、安装OCI8 PHP扩展(使用PHP自带的OCI8,假设PHP程序安装在/usr/local/webserver/php/)
4、修改PHP配置文件(/usr/local/webserver/php/etc/php.ini)
在extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"后增加一行:
5、重启PHP
6、创建一个phpinfo.php文件(内容如下)并通过Web访问,如果有“oci8”这一项,则表明安装成功。
![点击在新窗口中浏览此图片 点击在新窗口中浏览此图片](attachment.php?fid=12)
![](https://cdn.phpts.cn/phpts/www/webstatic/img/logo@2x.png)
![](https://cdn.phpts.cn/phpts/images/software/phptsbnew.jpg)
1、下载Oracle即时客户端程序包 — Basic: 运行 OCI、OCCI 和 JDBC-OCI 应用程序所需的所有文件
①、打开以下网址(本文以32位版为例):
(Linux 32位版)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
(Linux 64位版)http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxx86_64soft.html
②、下载以下几个文件:
oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm
oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
2、安装Oracle即时客户端程序包
rpm -ivh oracle-instantclient11.1-basic-11.1.0.7.0-1.i386.rpm oracle-instantclient11.1-devel-11.1.0.7.0-1.i386.rpm oracle-instantclient11.1-sqlplus-11.1.0.7.0-1.i386.rpm
echo "/usr/lib/oracle/11.1/client/lib/" > /etc/ld.so.conf.d/oracle_client.conf
/sbin/ldconfig
echo "/usr/lib/oracle/11.1/client/lib/" > /etc/ld.so.conf.d/oracle_client.conf
/sbin/ldconfig
3、安装OCI8 PHP扩展(使用PHP自带的OCI8,假设PHP程序安装在/usr/local/webserver/php/)
yum install libaio
wget http://pecl.php.net/get/oci8-1.3.5.tgz
tar zxvf oci8-1.3.5.tgz
cd oci8-1.3.5/
/usr/local/webserver/php/bin/phpize
CFLAGS="-I/usr/include/oracle/11.1/client/"
CXXFLAGS="-I/usr/include/oracle/11.1/client/"
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-oci8=/usr/lib/oracle/11.1/client/
make
make install
wget http://pecl.php.net/get/oci8-1.3.5.tgz
tar zxvf oci8-1.3.5.tgz
cd oci8-1.3.5/
/usr/local/webserver/php/bin/phpize
CFLAGS="-I/usr/include/oracle/11.1/client/"
CXXFLAGS="-I/usr/include/oracle/11.1/client/"
./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-oci8=/usr/lib/oracle/11.1/client/
make
make install
4、修改PHP配置文件(/usr/local/webserver/php/etc/php.ini)
在extension_dir = "/usr/local/webserver/php/lib/php/extensions/no-debug-non-zts-20060613/"后增加一行:
extension = "oci8.so"
5、重启PHP
6、创建一个phpinfo.php文件(内容如下)并通过Web访问,如果有“oci8”这一项,则表明安装成功。
<?php
phpinfo();
?>
phpinfo();
?>
![](https://cdn.phpts.cn/phpts/www/webstatic/img/logo@2x.png)
![](https://cdn.phpts.cn/phpts/images/software/phptsbnew.jpg)
静态页面交给apache处理
动态jsp页面交给jboss处理
[general]
db.adapter=PDO_Oci
会出现'The oci driver is not currently installed' 是什么原因
我的php是rpm默认安装的,我找不到php/bin/phpize,还有
CFLAGS="-I/usr/include/oracle/11.1/client/"
CXXFLAGS="-I/usr/include/oracle/11.1/client/"
这2句话是做什么的呀?写的哪里的?
我的oci8-1.3.5目录下没有configure文件呀
张大哥,这2个问题怎么修改阿??
/data0/software/oci8-1.3.5/oci8.c:3082: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'php_oci_ping_init'
make: *** [oci8.lo] 错误 1
it works .
根据asdf的提示,终于编译成功了。