PDO_OCI: could not find driver

Today my problem is with PDO, OCI8 and PDO_OCI. But from the very beginning.

I am using Ubuntu 11.10 and PHP version: 5.3.8-1ubuntu3. I installed Oracle 10g Express, configured it, and it works great. The next step I had to do was integrate between Oracle and PDO. So I found this link: http://lacot.org/blog/2009/11/03/ubuntu-php5-oci8-and-pdo_oci-the-perfect-install.html and do it step by step (without installing PDO, which was installed earlier with pdo_mysql). When I tried to do this on Ubuntu 10.10, it worked. Now, on 11.10, I get the error message “I can’t find the driver” when I try to open the application for the website.

I checked phpinfo () and in the PDO line there is: PDO support - enabled, PDO drivers - mysql. This section does not say anything about oci, although there are few lines. I have a PDO driver for OCI 8 and later.

Hope someone can help with this. Regards, Mateo.

+4
source share
2 answers

You need to recompile PHP with PDO_OCI support:

--with-pdo-oci=instantclient,/usr,10.2.0.3 

Of course, replaces the client client version with the one you installed.

PDO is an access type. MySQL and OCI are database types. If you installed the basic PDO package, you still need to install the drivers. By default, drivers are not shipped with PDO. When you installed MySQL PDO, the OCI PDO was not installed, as it is a separate module.

0
source

You can also use pecl. This way you can avoid recompiling PHP and continue to use Ubuntu PHP packages. See This Tutorial: Installing PHP and Oracle PDO Drivers on Ubuntu .

0
source

Source: https://habr.com/ru/post/1390880/


All Articles