Download instant client 12.2 basic and basic devel rpm from oracle
alien -kv oracle-instantclient12*.rpm
sudo dpkg -i oracle-instantclient12*.deb
You need php dev version installed. Use instantclient,/usr/lib/oracle/12.2/client64/lib/
when asked by pecl.
sudo pecl -d php_suffix=7.1 install oci8 ; sudo pecl uninstall -r oci8
sudo pecl -d php_suffix=7.2 install oci8 ; sudo pecl uninstall -r oci8
; configuration for php oci8 module
; priority=20
extension=oci8.so
Put text above in /etc/php/7.1/mods-avaiable/oci8.ini and /etc/php/7.2/mods-avaiable/oci8.ini
phpenmod -v 7.1 -s ALL oci8
phpenmod -v 7.2 -s ALL oci8
sudo systemctl restart 'php*'
php -m | grep oci8
oci8
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/oci8.so' - libmql1.so: cannot open shared object file: No such file or directory in Unknown on line 0
sudo sh -c "echo /usr/lib/oracle/12.2/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"
sudo ldconfig