環境
System:CentOS 6
PHP: 5.3.28
下載Oracle客戶端
32位系統
64位系統
復制代碼 代碼如下:
oracle-instantclient-sqlplus-10.2.0.4-1.x86_64.rpm
oracle-instantclient-jdbc-10.2.0.4-1.x86_64.rpm
oracle-instantclient-devel-10.2.0.4-1.x86_64.rpm
oracle-instantclient-basic-10.2.0.4-1.x86_64.rpm
執行安裝:
復制代碼 代碼如下:
# rpm -ivh *.rpm
下載Oracle的PHP擴展
官方下載
復制代碼 代碼如下:
wget http://pecl.php.net/get/oci8-2.0.7.tgz
# tar zxvf oci8-2.0.7.tgz
# cd oci8-2.0.7
# /usr/local/php/bin/phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/10.2.0.4/client64/lib/
# make && make install
更改php.ini
復制代碼 代碼如下:
# vi /usr/local/php/etc/php.ini
增加 extension = "oci8.so"
重新啟動PHP
復制代碼 代碼如下:
ps aux | grep php | grep root
kill -USER2 php_root_pid