下载Oracle客户端
官方下载地址: Linux X86-64
同意协议,下载以下文件:
- oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
- oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
安装
rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
basic 默认安装在 /usr/lib/oracle/
下
devel 默认安装在 /usr/include/oracle/
下
安装PHP扩展
cd php-5.3.3/ext/oci8
phpize
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/:$LD_LIBRARY_PATH
export ORACLE_HOME="/usr/lib/oracle/11.2/client64/"
export CFLAGS="-I/usr/include/oracle/11.2/client64/"
export CXXFLAGS="-I/usr/include/oracle/11.2/client64/"
./configure --with-php-config=/usr/local/bin/php-config --with-oci8=/usr/lib/oracle/11.2/client64/
make
make isntall
修改PHP配置文件
extension=oci8.so
重启,完成