Install Oracle OCI8 for PHP 8.2 Ubuntu 22.04
Get the link for the latest RPM
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
As of 26 March 2023
wget -c https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-basic-21.9.0.0.0-1.el8.x86_64.rpm
wget -c https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-basiclite-21.9.0.0.0-1.el8.x86_64.rpm
wget -c https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-sqlplus-21.9.0.0.0-1.el8.x86_64.rpm
wget -c https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-tools-21.9.0.0.0-1.el8.x86_64.rpm
wget -c https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-devel-21.9.0.0.0-1.el8.x86_64.rpm
wget -c https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-jdbc-21.9.0.0.0-1.el8.x86_64.rpm
wget -c https://download.oracle.com/otn_software/linux/instantclient/219000/oracle-instantclient-odbc-21.9.0.0.0-1.el8.x86_64.rpm
## ===>
apt install alien
### alien -v --scripts
alien -v --scripts oracle-instantclient-basic-21.9.0.0.0-1.el8.x86_64.rpm oracle-instantclient-devel-21.9.0.0.0-1.el8.x86_64.rpm oracle-instantclient-odbc-21.9.0.0.0-1.el8.x86_64.rpm oracle-instantclient-tools-21.9.0.0.0-1.el8.x86_64.rpm oracle-instantclient-basiclite-21.9.0.0.0-1.el8.x86_64.rpm oracle-instantclient-jdbc-21.9.0.0.0-1.el8.x86_64.rpm oracle-instantclient-sqlplus-21.9.0.0.0-1.el8.x86_64.rpm
dpkg -i oracle-instantclient-basic_21.9.0.0.0-2_amd64.deb oracle-instantclient-devel_21.9.0.0.0-2_amd64.deb oracle-instantclient-odbc_21.9.0.0.0-2_amd64.deb oracle-instantclient-tools_21.9.0.0.0-2_amd64.deb oracle-instantclient-jdbc_21.9.0.0.0-2_amd64.deb oracle-instantclient-sqlplus_21.9.0.0.0-2_amd64.deb
=====>
check for this file with ls command
/etc/ld.so.conf.d/oracle-instantclient.conf
ldconfig
apt install libaio-dev
apt install php8.2-dev php-pear build-essential libaio1
apt install php-pear
pecl channel-update pecl.php.net
pecl install oci8
###===>
Build process completed successfully
Installing '/usr/lib/php/20220829/oci8.so'
install ok: channel://pecl.php.net/oci8-3.2.1
configuration option "php_ini" is not set to php.ini location
You should add "extension=oci8.so" to php.ini
###====>
edit fail /etc/php/8.2/cli/php.ini dan /etc/php/8.2/fpm/php.ini (cari oci8)
extension=oci8.so
===>
### php 7.4 ### pecl install oci8-2.2.0
##===>
oci8.events = On
###====>
Configuring PHP for FAN
With the enhanced OCI8 extension, a php.ini configuration parameter oci8.events allows PHP to be
notified of FAN events:
oci8.events = On
FAN support is only available when PHP is linked with Oracle 10gR2 or 11g libraries and connecting to
Oracle Database 10gR2 or 11g. Review the patches for Oracle bugs 7143299 (fixed in Oracle 11.2.0.1) and
8670389 (fixed in 11.2.0.2) to improve login times in various conditions when using oci8.events
Harisfazillah Jamel ( LinuxMalaysia )
26 March 2023