Oracle DB Installation
Contents
Drivers
Requirements
- You will need the following items from your package manager (linux)
- PHP Pear and PHP Dev (for PECL)
- Development tools / (e.g. Build Essential tools)
- libaio1
- For Windows you will just need an OCI8 dll file from PHP PECL (or from Bitnami)
- Oracle Instant Client Files
- Download the basic and sdk instant client files: Oracle Instant Client Downloads
- Example Filenames:
- instantclient-basic-linux.x64-12.1.0.2.0.zip
- instantclient-sdk-linux.x64-12.1.0.2.0.zip
Driver Install
- In Linux you will need to use PECL to build the OCI8 module, pointing to the unzipped instant client files as the library. Then enable the module in PHP.
- In Windows you will need to add the unzipped instant client files to your PATH variable and restart the machine. Then enable the module in PHP.
For concrete examples, see the Ubuntu 16.04 instructions or the Bitnami Windows instructions.
Oracle Instant Client Instructions for Linux
- Navigate to http://www.oracle.com/technetwork/database/database-technologies/instant-client/downloads/index.html and download an appropriate Oracle Instant Client such as Instant Client for Linux x86-64.
- Accept the license agreement and download the Basic package to your server. Unzip the file and move the directory to /usr/local/lib.
- pecl download OCI8
- tar zxvf oci8-2.1.8.tgz
- cd oci8-2.1.8.tgz
- phpize
- ./configure --with-oci8=instantclient,/usr/local/lib/instantclient_18_3
- sudo make install
- cd /etc/php/7.0/mods-available/
- Create a file named oci8.ini and add extension=oci8.so to it. Save the file.
- sudo ln -s /etc/php/7.0/mods-available/oci8.ini /etc/php/7.0/cli/conf.d/20-oci8.ini
- sudo systemctl restart nginx
- sudo service php7.0-fpm restart
Don't Need Oracle?
DreamFactory's Silver and Gold licenses include the Oracle connector by default, however if you don't require Oracle support and therefore don't install the OCI8 extension then you'll encounter the following error:
Problem 2 - Installation request for yajra/laravel-oci8 v5.5.8 -> satisfiable by yajra/laravel-oci8[v5.5.8]. - yajra/laravel-oci8 v5.5.8 requires ext-oci8 >=2.0.0 -> the requested PHP extension oci8 is missing from your system.
You can forgo the Oracle extension requirement by following these instructions:
Open composer.json and delete this block:
{ "type": "vcs", "url": "https://github.com/dreamfactorysoftware/df-oracledb" },
Scroll further down composer.json, and remove the line beginning with dreamfactory/df-oracledb":
When removing these lines, be sure to remove the concluding comma, and leave the preceding comma intact.
Save your changes, and run the following command from your project's root directory:
$ composer update dreamfactory/df-oracledb --ignore-platform-reqs
If you instead run composer install --ignore-platform-reqs after making this change, you'll see the following warning:
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.
This isn't a particularly big deal, however in the interests of ensuring your composer.json and composer.lock files are synchronized, run the aforementioned composer update command after the composer install command completes, at which point you are done.