CentOS 7 – Install Oracle Instant Client & PHP 7.3 OCI8 Module

 

sudo yum install php73-php-oci8
wget https://download.oracle.com/otn_software/linux/instantclient/211000/oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
sudo rpm -ivh oracle-instantclient-basic-21.1.0.0.0-1.x86_64.rpm
sudo systemctl restart php73-php-fpm

— OR —

mkdir oci8
cd oci8
wget https://download.oracle.com/otn_software/linux/instantclient/213000/oracle-instantclient-basic-21.3.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/213000/oracle-instantclient-devel-21.3.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/213000/oracle-instantclient-jdbc-21.3.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/213000/oracle-instantclient-odbc-21.3.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/213000/oracle-instantclient-sqlplus-21.3.0.0.0-1.x86_64.rpm
wget https://download.oracle.com/otn_software/linux/instantclient/213000/oracle-instantclient-tools-21.3.0.0.0-1.x86_64.rpm
sudo yum install oracle-instantclient-*
sudo yum groupinstall "Development tools"
sudo yum --enablerepo=remi-php73 install php-oci8
sudo su -
wget https://pecl.php.net/get/oci8-2.2.0.tgz
tar xzf oci8-2.2.0.tgz
cd oci8-2.2.0/
export PHP_DTRACE=yes
phpize
./configure --with-oci8=shared,instantclient,/usr/lib/oracle/21/client64/lib/
make && make install
sudo vi /etc/php.ini

[OCI8]
extension=oci8.so
sudo systemctl restart php-fpm
sudo systemctl restart httpd