> This procedure will only work if you have a Scriptcase manual installation in your server.
>
> - [Installing PHP 7.0](https://www.scriptcase.net/docs/en_us/v9/manual/02-scriptcase-installation/06-linux_php/)
> - [Installing the Scriptcase Manually](https://www.scriptcase.net/docs/en_us/v9/manual/02-scriptcase-installation/08-manual_sc/)

## To connect with Oracle in a Linux System, we must follow these steps below:

Step 1 -  Installing these packages:

|  |  |
| --- | --- |
| UBUNTU/DEBIAN | CENTOS/RHEL |
| - sudo apt-get update  - sudo apt-get install libaio1  - sudo apt-get install libncurses5  - sudo apt-get install alien  - sudo apt-get install gcc-multilib g++-multilib  - sudo apt-get install libpam0g  - sudo apt-get install unixodbc-dev unixodbc | - sudo yum update - sudo yum install libaio-devel - sudo yum install libaio - sudo yum install glibc - sudo yum install compat-libstdc++-33 - sudo yum install glibc-devel - sudo yum install libstdc++ - sudo yum install pam - sudo yum install ncurses-devel - sudo yum install unixODBC |

Step 2 - Install the Instant Client:

Download the Instant Client version compatible with the archicteture x64:

- [Client basic Linux ( x64 )](http://cdn1.netmake.com.br/download/Conexao/Oracle/Linux/oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm)
- [Client devel Linux ( x64 )](http://cdn1.netmake.com.br/download/Conexao/Oracle/Linux/oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm)

|  |  |
| --- | --- |
| UBUNTU/DEBIAN | CENTOS/RHEL |
| - sudo alien oracle-instantclient12.1-devel-12.1.0.2.0-1.x86\_64.rpm - sudo alien oracle-instantclient12.1-basic-12.1.0.2.0-1.x86\_64.rpm - sudo dpkg -i oracle-instantclient12.1-basic\_12.1.0.2.0-2\_amd64.deb - sudo dpkg -i oracle-instantclient12.1-devel\_12.1.0.2.0-2\_amd64.deb | - sudo yum install oracle-instantclient12.1-basic-12.1.0.2.0-1.x86\_64.rpm - sudo yum install oracle-instantclient12.1-devel-12.1.0.2.0-1.x86\_64.rpm |

Step 3 - Copy the extension to the PHP extensions directory:

Download and extract the attached file(oci8.zip) and move this file in the PHP extensions directory.

> Accessing the info.php file, search for the line extension\_dir. This line will inform the exact path to the PHP extensions.

![](https://desk.zoho.com/DocsDisplay?zgId=716875472&mode=inline&blockId=lfc28a857b27d19bd4e5681b2674eead3c0cb)

Step 4 - Edit the php.ini file:

Now that the extension was pasted at the directory, you will need to add at the bottom of the php.ini file this line below:

extension=oci8.so

![](https://desk.zoho.com/DocsDisplay?zgId=716875472&mode=inline&blockId=lfc28314d44a3073b41c7b0a3718eeed1a04e)

Step 5 - Declare the environment variable responsible to identify the Oracle library:

Now it is necessary to declare the variable LD\_LIBRARY\_PATH in the responsible file for your system environment variables.

Check the path according to your System:

|  |  |
| --- | --- |
| UBUNTU/DEBIAN | CENTOS/RHEL |
| - sudo nano /etc/apache2/envvars | - sudo nano /etc/sysconfig/httpd |

The path to the library will depend on your installation. However, by default the path might be the same as this example:

Following the same example from php.ini, you will need to add just this variable at the bottom of the file with this syntax:

export LD\_LIBRARY\_PATH=/usr/lib/oracle/12.1/client64/lib/

> If you are using CentOS/RHEL, you don't need to use the 'export' before the variable.

![](https://desk.zoho.com/DocsDisplay?zgId=716875472&mode=inline&blockId=lfc2881d3cd88a5d744c8914790ab8f295dcf)

> After doing all these procedures, you will need to restart your apache service.

|  |  |
| --- | --- |
| UBUNTU/DEBIAN | CENTOS/RHEL |
| - sudo service apache2 restart | - sudo systemctl restart httpd |