Oracle DB MacOS
From DreamFactory
This module will allow you to access Oracle databases. These instructions assumes you are installing with the latest Oracle instant client (12.1) which is backwards compatible to Oracle 10. If you need compatibility back to Oracle 9, use the 11.2 instant client files from Oracle, and adjust the filenames in the instructions accordingly.
- Get the prerequisites
- Get the Instant Client Files
- Download the basic and sdk instant client files for Linux x86-64, version 12.1 from this link: Oracle Instant Client Downloads
- Filenames:
- instantclient-basic-linux.x64-12.1.0.2.0.zip
- instantclient-sdk-linux.x64-12.1.0.2.0.zip
- Copy the instant client files to your home directory (~) on the server
- Unzip and move the files to
/opt/instantclient_12_1
- <source lang="bash">$ cd ~</source>
- <source lang="bash">$ unzip instantclient-basic-linux.x64-12.1.0.2.0.zip</source>
- <source lang="bash">$ unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip</source>
- <source lang="bash">$ sudo mv instantclient_12_1 /opt/</source>
- Create a symlink for the .so in the instantclient directory
- <source lang="bash">$ sudo ln -s /opt/instantclient_12_1/libclntsh.so.12.1 /opt/instantclient_12_1/libclntsh.so</source>
- Install the oci8 driver using PECL
- <source lang="bash">$ sudo pecl install oci8</source>
- When asked for the ORACLE_HOME directory during install type
instantclient,/opt/instantclient_12_1
- You should see a message indicating that the oci8.so was successfully installed to the extensions directory
- Create the oci8.ini file using Nano
- <source lang="bash">$ sudo nano /etc/php/7.0/mods-available/oci8.ini</source>
- Edit the file so that it simply says
extension=oci8.so
- Save and exit the file
- Enable the module in PHP
- <source lang="bash">$ sudo phpenmod oci8</source>
- Verify the module is successfully working with PHP
- <source lang="bash">$ php -m | grep oci8</source>