Basically I followed a tutorial, I'll pass it on to the answer and link it to the end of the answer:
Oracle Instant Client installation
Step 1:
Download Oracle Instant Client and SDK of the Oracle site. Be sure to choose the correct architecture for the installation (32bit x86, 64bit x86_64). You will need to upload the files to your server using whatever method suits you.
Step 2:
Create a new folder to store Oracle Instant Client zip files on your server.
Running the command:
sudo mkdir /opt/oracle
Step 3:
Now extract the files:
cd /opt/oracle
sudo unzip instantclient-basic-linux-12.1.0.2.0.zip
sudo unzip instantclient-sdk-linux-12.1.0.2.0.zip
Step 4:
Create a symbolic link to the 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.so
Step 5: (in this step I needed to change permissions on ld.so.conf.d
with sudo chmod 777
)
Add the folder at ldconfig
echo /opt/oracle/instantclient_12_1 > /etc/ld.so.conf.d/oracle-instantclient
Step 6:
Update dynamic linker runtime links
sudo ldconfig
Installing OCI8
1st step: (I did not do this step, I used php 7.1.1
)
Run these commands to install php-dev:
sudo apt-get install php-pear php5-dev build-essential libaio1
Step 2:
Once installed, we need to get the OCI8 file.
pecl install oci8-2.0.10
When the prompt asks where the Instant Client is, type:
instantclient,/opt/oracle/instantclient_12_1
Step 3:
Enable the extension of oci8 in
sudo echo "extension = oci8.so" >> /etc/php5/fpm/php.ini
sudo echo "extension = oci8.so" >> /etc/php5/cli/php.ini
Step 4:
Restart your PHP and nginx / apache.
service php5-fpm restart
service nginx(ou apache) restart
Source: syahzul