linux如何开启php的oci扩展

1.安装oracle的底层协议支持

rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.i386.rpm

rpm -ivh oracle-instantclient11.2-devel-11.2.0.2.0.i386.rpm

oracle-instantclient可以到oracle的官方下载。我的系统是32位的,如果是64位系统请下载

oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpmoracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm

二、安装php的相应扩展

oci8-1.4.10.tgz

1.tar zxvf oci8-1.4.10.tgz

2.cd oci8-1.4.10

3./usr/local/php/bin/phpize CFLAGS="-I/usr/include/oracle/11.2/client/" CXXFLAGS="-I/usr/include/oracle/11.2/client/"(注意:如果是64位的系统,client改成 client64)4../configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=instantclient,/usr/lib/oracle/11.2/client/lib/

make

make install

cd /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

三、 修改php.ini 配置extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"extension = "pdo_mysql.so"extension = "oci8.so"

四、重启apahce /或者nginx

你可能感兴趣的:(CentOS)