I cannot provide what is missing in your case.
Here are all the steps to enable oci 8 for php-fpm.
First install oci8.so using steps bellow:
Install PECL, PHP Development files, Build Essential, Unzip, and the AIO Library
apt-get install php-pear php7.0-dev build-essential unzip libaio1
Create the oracle directory
mkdir /opt/oracle
Download instant client from this link. Download 11.2 Basic & SDK. Only 11.2 version was working for me.
Move the downloaded files
mv instantclient-* /opt/oracle
Unzip the files using the unzip command (unzip )
Rename the created directory
mv instantclient_11_2 instantclient
cd into the instant client directory and create the following soft links
ln -s libclntsh.so.11.2 libclntsh.so
ln -s libocci.so.11.2 libocci.so
cd to /opt
set the permissions on the directory
chown -R root:www-data /opt/oracle
Add the instant client to the the ld config files
echo /opt/oracle/instantclient > /etc/ld.so.conf.d/oracle-instantclient
Update the Dynamic Linker Run-Time Bindings
ldconfig
Install OCI8 using PECL
pecl install oci8
When you are pompted for the client location enter the following:
instantclient,/opt/oracle/instantclient
Lastly configure php.ini
At this moment your oci8.so is ready to be use. Just include into your php.ini file.
cd /etc/php/mods-available/
vi oci.ini
then add this line to the file "extension=oci8.so"
Now create a symlink like this:
cd /etc/php/7.0/fpm/config.d/
ln -s /etc/php/mods-available/oci.ini 20-oci.ini
Add oracle enviroment variables:
vi /etc/environment
Add the following lines:
# Oracle Instant Client
export LD_LIBRARY_PATH="/opt/oracle/instantclient"
export TNS_ADMIN="/opt/oracle/instantclient"
export ORACLE_BASE="/opt/oracle/instantclient"
export ORACLE_HOME=$ORACLE_BASE
Finally restart fpm service:
sudo php7.0-fpm restart
You must be able to check oci8 extension through phpinfo.