#ls
oracle-instantclient-basic-10.2.0.3-1.i386.rpm
oracle-instantclient-devel-10.2.0.3-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.3-1.i386.rpm
instantclient-sdk-linux32-10.2.0.3-20061115.zip
#rpm -ivh *.i386.rpm
Preparing... ########################################### [100%]
1:oracle-instantclient-ba########################################### [ 33%]
2:oracle-instantclient-de########################################### [ 67%]
3:oracle-instantclient-sq########################################### [100%]
#echo "/usr/lib/oracle/10.2.0.3/client/lib/" >> /etc/ld.so.conf.d/oracle_client.conf
#ldconfig
unzip instantclient-sdk-linux32-10.2.0.3-20061115.zip(把这个包include下的文件copy到oci8目录下)
#yum install libaio
wget
tar zxvf oci8-1.3.5.tgz
cd oci8-1.3.5/
cd /usr/lib/oracle/10.2.0.3/client/
cp * /root/soft/oci8-1.3.5
/usr/local/php/bin/phpize(注意系统当前的php版本根据系统当前php版本走,回到上级目录执行)
CFLAGS="-I/usr/lib/oracle/10.2.0.3/client/"
CXXFLAGS="-I/usr/lib/oracle/10.2.0.3/client/"
./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=/usr/lib/oracle/10.2.0.3/client/
export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client/
再在php.ini里添加
安装pdo_oci
支持pdo
先安装 yum install re2c
export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/client/ #这步很重要,不要后面加/lib
/usr/local/php/bin/pecl download pdo_oci
tar zvxf PDO_OCI-1.0.tgz
cd PDO_OCI-1.0
/usr/local/php/bin/phpize (回到上级目录执行)
./configure --with-php-config=/usr/local/php/bin/php-config
cp /usr/include/oracle/10.2.0.3/client/* include/
make
make install
修改php.ini
extension=pdo_oci.so
重启apache看phpinfo
阅读(1325) | 评论(0) | 转发(0) |