A
A
AlxMrz2017-10-10 13:42:50
Yii
AlxMrz, 2017-10-10 13:42:50

How to properly connect to Oracle Yii2 DB?

Good afternoon!
I am using Yii2 for a project. I make an Oracle database connection through the web.php file. In components I write:

'dbO' => [
            'class' => 'yii\db\Connection',
            'dsn'=>'oci:dbname=//{{ЗДЕСЬ МОЙ ХОСТ}};charset=AL32UTF8;',
            'username'=>'username',
            'password'=>'password',
        ],

At the same time I get an error: could not find driver
Googled 2 solutions:
1) PDO_OCI
2) A third-party class that simulates PDO for Oracle
However, I would like to know how to connect correctly. Maybe there is some "official" way that is supported by the Yii developers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-10-10
@webinar

php.net/manual/en/ref.pdo-oci.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question