Posted in Database Doctrine, Uncategorized

ZF2, Doctrine & Oracle

To do: Setting up Doctrine to use Oracle
So, here we go.

  • I assume you have added Doctrine module, if not refer here
  • Next open your
    config/autoload/local.php

    & add the configuration as follows

    return array(
        'doctrine' => array(
            'connection' => array(
                'orm_default' => array(
                    'driverClass' => 'Doctrine\DBAL\Driver\OCI8\Driver',
                    'params' => array(
                        'host'     => '192.168.4.136',
                        'port'     => '1521',
                        'user'     => 'iamuser',
                        'password' => 'xxxx',
                        'dbname'   => 'mydb',
                        'driver'   => 'oci8',
                        'service'  => true,
                        'servicename'=>'godisgreat'
                    )
                )
            )
        )
       );
    
  • Next, install libiao
    sudo apt-get install libaio1

    Then install the oci8 driver . You can dowload it from Oracle’s site

  • Now, enable it in php.ini. Open it
    sudo vi /etc/php5/apache2/php.ini
    

    & add the extension like

    extension=oci8.so
    
  • Don’t forget to restart apache
Advertisements

Author:

I am a passionate software developer currently located in Bengaluru. I love creating beautiful stuffs, reading and soccer. When I am not in front of the PC, you'll find me EITHER day dreaming ;-) OR playing soccer OR reading . FCB and NEUFC are my favorite clubs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s