Source: http://www.syahzul.com/2016/04/06/how-to-install-oci8-on-ubuntu-14-04-and-php-5-6/
Download the Oracle Instant Client and SDK from Oracle website. (Need to login in Oracle page)
http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Files: instantclient-basic-linux.x64-12.1.0.2.0.zip and instantclient-sdk-linux.x64-12.1.0.2.0.zip.
Create a new folder to store Oracle Instant Client zip files on your server.
Upload the Instant Clients files inside this folder.
mkdir /opt/oracleNow we need to extract the files.
cd /opt/oracle
unzip instantclient-basic-linux.x64-12.1.0.2.0.zip
unzip instantclient-sdk-linux.x64-12.1.0.2.0.zipNext, we need to create a symlink to Instant Client files.
ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so
ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.soAdd the folder to our ldconfig.
echo /opt/oracle/instantclient_12_1 > /etc/ld.so.conf.d/oracle-instantclientUpdate the Dynamic Linker Run-Time Bindings
ldconfigDone. Now we can proceed to the next part.
To install the OCI8 extension, we need to install some additional package on our server.
Run these command:
apt-get install php-dev php-pear build-essential libaio1Once installed, we need to get the OCI8 file.
pecl install oci8When you are prompted for the Instant Client location, enter the following:
instantclient,/opt/oracle/instantclient_12_1We need to tell PHP to load the OCI8 extension.
echo "extension = oci8.so" >> /etc/php/7.1/fpm/php.ini
echo "extension = oci8.so" >> /etc/php/7.1/cli/php.iniCheck if the extension is enabled.
php -m | grep 'oci8'If returns oci8, its works!
Restart the PHP-FPM
service php7.1-fpm restartNow you can connect to Oracle DBMS from your PHP applications.

@nwaweru Where are you seeing that message? In the terminal, when you execute
php? Or when you attempt to start the webserver? Also, which OS are you using?If you're seeing that error in the terminal, then you need to add the Instant Client path to the environment. On Ubuntu 18.04 LTS, for example:
You should then log out of the terminal session and then back in, and the error should disappear.
If you're seeing this error when you start the
apache2daemon, then you need to add theLD_LIBRARY_PATHvalue to your Apache environment, e.g.:And then restart the Apache service.
For whatever reason, none of this was needed on Ubuntu 16.04 LTS, but it appears to be required in Ubuntu 18.04 LTS.
Unfortunately, I can't figure out how to apply the same solution to PHP-FPM running via NGINX. I've tried adding
to the effective FPM pool configuration, and while the
Environmentsection ofphpinfo()'s output reflects the above value, the OCI8 extension simply does not load. I don't see any errors in relation tolibmql1.soin the FPM log, either, even with verbosity set todebug. Really frustrating!!!