Skip to content

Instantly share code, notes, and snippets.

@aronkerr
Last active December 20, 2015 21:18
Show Gist options
  • Save aronkerr/6196421 to your computer and use it in GitHub Desktop.
Save aronkerr/6196421 to your computer and use it in GitHub Desktop.
Zend Framework 2 - Setup Oracle DB connection
<?PHP
return array(
'adapters' => array(
'db' => array(
'connection1' => array(
'driver' => 'Oci8',
'connection' => 'orcl',
'username' => 'username',
'password' => 'password',
'character_set' => 'AL32UTF8',
),
'connection2' => array(
'driver' => 'Oci8',
'connection' => 'orcl',
'username' => 'username',
'password' => 'password',
'character_set' => 'AL32UTF8',
)
)
);
<?php
return array(
'db' => array(
'driver' => 'Oci8',
'connection' => 'orcl', // Name of conenction in tnsnames.ora
'username' => 'username', // Username to access db
'password' => 'password', // Password to access db
/*
* Explictly set the character set here or the oracle driver will create null characters where
* special characters are used.
*/
'character_set' => 'AL32UTF8',
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment