The process has been tested on new servers that have been set up using Virtualmin's installation script.
Download the latest version of Instant Client for Linux x86-64 (64-bit). As an example, we will be installing version 19.5.0.0.0 (requires glibc 2.14). You only need to download the Basic Package (ZIP) and the SDK Package (ZIP).
wget -c https://download.oracle.com/otn_software/linux/instantclient/195000/instantclient-basic-linux.x64-19.5.0.0.0dbru.zipwget -c https://download.oracle.com/otn_software/linux/instantclient/195000/instantclient-sdk-linux.x64-19.5.0.0.0dbru.zipExtract the downloaded archives to an arbitrary location. We'll use /usr/lib/oracle/.
sudo mkdir -p /usr/lib/oracle/sudo unzip -d /usr/lib/oracle/ instantclient-basic-linux.x64-19.5.0.0.0dbru.zipsudo unzip -d /usr/lib/oracle/ instantclient-sdk-linux.x64-19.5.0.0.0dbru.zipOptionally, you might need to create the symbolic link, if it has not been created by extracting the archives.
sudo ln -s /usr/lib/oracle/instantclient_19_5/libclntsh.so.19.1 /usr/lib/oracle/instantclient_19_5/libclntsh.soAdd the path to the shared Instant Client library files and configure dynamic linker run-time bindings.
sudo sh -c "echo /usr/lib/oracle/instantclient_19_5 > /etc/ld.so.conf.d/oracle.conf"sudo ldconfigInstall the required Ubuntu packages. Some may have been installed already.
sudo sudo apt-get install php-dev php-db libaio1Install the PECL OCI8 package.
sudo pear install pecl/oci8During installation, you will be prompted for the path to the ORACLE_HOME directory. Enter the path exactly as follows:
instantclient\,/usr/lib/oracle/instantclient_19_5
After the build process completes, we need to enable PHP to load the OCI8 extension. That should automatically create a symbolic link, /etc/php/7.2/apache2/conf.d/20-oci8.ini.
sudo echo "extension=oci8.so" > /etc/php/7.2/mods-available/oci8.inisudo phpenmod oci8We now need to restart Apache.
sudo service apache2 restartVerify that the OCI8 extension has been installed and that it can be loaded by PHP.
php -m | grep oci8echo "<?php phpinfo();" | php | grep "OCI8 Support"