This article describes how to install the Oracle extension in PHP in CentOS. This article describes the environment, download the Oracle client, change php. ini, and restart PHP. For more information, see
Environment
System: CentOS 6
PHP: 5.3.28
Download the Oracle client
32-bit system
64-bit system
The code is as follows:
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
Install:
The code is as follows:
# Rpm-ivh *. rpm
Download the PHP extension of Oracle
Official Download
The code is as follows:
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
Change php. ini
The code is as follows:
# Vi/usr/local/php/etc/php. ini
Added extension = "oci8.so"
Restart PHP
The code is as follows:
Ps aux | grep php | grep root
Kill-USER2 php_root_pid