Yii - Oracle Connection


I’m trying to connect my yii project with oracle database, but nothing is working.

I have already tried this


and this


But none of them has worked, the page just gets blank and shows no errors that would help to debug when I print var_dump(Yii::app()->db);

The current connection db in config/main.php is like this



        'connectionString' => 'oci:dbname=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT=***))(CONNECT_DATA=(SERVICE_NAME=***)));charset=UTF8;',




Note: ‘***’ are correctly placed.

What’s wrong? What else could I try? Can someone help me please urgently…

When you are using the oci8Pdo extension:

'db' => array(


  'connectionString' => 'oci:dbname=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=***)(PORT=***))(CONNECT_DATA=(SERVICE_NAME=***)));charset=AL32UTF8;',




Take note of the class and the charset. Works for me.

Thanks for your reply Yes I add this class and be informed I’m currently using oracle 9.

Thanks all

Oracle 9iR2 or above? See http://php.net/manual/en/oci8.requirements.php