connection between YII2 and Oracle


(Ikramadjissa) #1

Hello,

Can someone help to solve my probelem. I can’t connect YII2 to my DB oracle 11g.

I put this configuration on my mail-local file:

‘db’ => [

           'class' => 'yii\db\Connection'


           'dsn' => 'oci:dbname=//localhost:1521/orcl/immo_bdd',                       


          'username' => 'immo_bdd',


          'password' => 'immo2015',    


          'charset'=> 'UTF8',         		


    ],

I get this error:

Parse error: syntax error, unexpected ‘‘dsn’’ (T_CONSTANT_ENCAPSED_STRING), expecting ‘]’ in C:\wamp\www\Yii2Immo\advanced\common\config\main-local.php on line 17


(Fabrizio Caldarelli) #2

You are missing "," after class property.


(Ikramadjissa) #3

Thank you, Also I have installed OCI_PDO_11g for making it work