E
E
Eugene2019-09-20 11:30:39
Oracle
Eugene, 2019-09-20 11:30:39

How to connect Oracle to Yii2 and not hang yourself?

I'm getting an error when using oracle db

spoiler
Caused by: PDOException
could not find driver

What I did:
I downloaded Instant Client version 11.1.0.7.0
Client Oracle 11g 32 bit, I already have it installed. Everything works fine and I see the server base and work with it.
Registered global variables
5d848dc5aad46209973889.png
Even installed the 32-bit version of php and included it in php.ini
extension = oci8_12c
extension = pdo_oci

EVERYTHING still does not see the driver and gives the same error. How else can you solve the problem? The official php documentation doesn't help https://www.php.net/manual/en/oci8.installation.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2019-09-21
@evgen9586

I figured out the connection, it remains to teach him to see TNS-ki. But for people who will face a similar problem, I will sign:
1) You should have only 1 oci driver in global variables, and not two as I have above in the screenshots (1 driver from Oracle Client, another from instant client). If you have the oracle client installed, you don't need to install any instant client.
2) Give your server access to global Windows variables.
3) In php.ini, uncomment Oci (You should have 1 axis uncommented in total)
4) Catch the following error related to TNS) (Fixed, indicated the correct format for accessing TNS https://www.php.net/manual/en/ ref.pdo-oci.connecti...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question