简体   繁体   中英

PDO_OCI: could not find driver

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

I'm using Ubuntu 11.10 and PHP version: 5.3.8-1ubuntu3. I have installed Oracle 10g Express, configured it and it works fine. The next step I had to do was integration 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 instaling PDO, which was installed previously with pdo_mysql). When I tried to do it on Ubuntu 10.10 - it was working. Now, on 11.10 I get an error: 'Could not find driver' when I try to open my website application.

I checked phpinfo() and in the row PDO there are: PDO support - enabled, PDO drivers - mysql. There is nothing about oci in this section, although few lines under it I have PDO Driver for OCI 8 and later - enabled.

Hope somebody can help with this. Best regards, Mateo.

You need to recompile PHP with support for PDO_OCI:

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

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

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

You could also use pecl. That way you can avoid recompiling PHP and continue using Ubuntu's PHP packages. See this tutorial: Installing PHP & Oracle PDO Drivers on Ubuntu .

i have same problem. php.ini have now: extension_dir="c:\\bin\\php-73\\ext"

doesnt work with: extension_dir="c:/bin/php-73/ext" doesnt work with: extension_dir="ext"

Error returned by cmd php -v: C:\\php -v

Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: e:/bin/php-73/ext\\oci8_12c

How to correct this??? I tried too in httpd.conf PHPiniDir "e:/bin/php-73" not work, and this too not work: PHPiniDir "e:\\bin\\php-73"

Detail..., all files are at ext dir...

Windows 2019 server PHP 7.3.1... How i can correct this error?

Wow, how i can recompile??? Can explain better...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM