Connecting to Oracle: CodeIgniter vs Laravel Connecting to Oracle: CodeIgniter vs Laravel codeigniter codeigniter

Connecting to Oracle: CodeIgniter vs Laravel


After researching the link provided by fideloper it looks like some helpful coder(s) have continued to develop a PDO user-space driver for Oracle that takes advantage of the native OCI8 PHP driver functions.

According to this website this can be installed in Laravel by using composer:

Add yajra/laravel-oci8 as a requirement to composer.json:

{    "require": {        "yajra/laravel-oci8": "*"    }}

And then run:

composer update

Once Composer has installed or updated your packages you need to register the service provider. Open up app/config/app.php and find the providers key and add:

yajra\Oci8\Oci8ServiceProvider

Finally you need to setup a valid database configuration using the driver "pdo-via-oci8". Configure your connection as usual with:

'connection-name' => array(    'host' => 'something',    'port' => 'something',    'username' => 'something',    'password' => 'something',    'charset' => 'something',    'prefix' => 'something', )

Then Laravel can access Oracle in a database-agnostic way using Eloquent etc. I've given this some basic testing it seems to work well.


I'm not sure this will solve all issues, but this packagist library should make Oracle work with Laravel.

Note that OCI8 may still present an issue, however :/