简体   繁体   English

消息“找不到驱动程序”的未捕获异常“ PDOException”(到Oracle DB)

[英]Uncaught exception 'PDOException' with message 'could not find driver' (to an Oracle DB)

I've been encountering this error after installing Wamp, and have tried enabling all of the PDO's contained in php.ini (located in the Apache bin folder). 安装Wamp后,我一直遇到此错误,并尝试启用php.ini(位于Apache bin文件夹中)中包含的所有PDO。

The error is: 错误是:

PDOException: could not find driver in C:\wamp\www\common_db.php on line 27

Where line 27 is: 第27行是:

$db = new PDO("oci:dbname=".$oraDB, $dbusername, $dbuserpassword);

I have used phpinfo () to check which PDO's have been enabled. 我已经使用phpinfo()来检查启用了哪些PDO。 I've uploaded my php info onto Google Drive. 我已将我的PHP信息上传到Google云端硬盘。

I'm trying to connect to an Oracle database, and have php_pdo_oci.dll unchecked in php.ini. 我正在尝试连接到Oracle数据库,并在php.ini中取消选中php_pdo_oci.dll。 However, this doesn't appear to have resolved the missing driver error. 但是,这似乎无法解决丢失的驱动程序错误。

Might anybody know what driver I could possibly be missing? 可能有人知道我可能会缺少什么司机吗?

As well as enabling php_pdo_oci.dll in your PHP configuration, you also have to have an ORACLE driver installed on your system. 除了在PHP配置中启用php_pdo_oci.dll ,还必须在系统上安装ORACLE驱动程序。 The PHP extension is just an interface between your PHP code and the ORACLE driver, or Instant Client as it is called. PHP扩展仅仅是PHP代码与ORACLE驱动程序(即所谓的Instant Client)之间的接口。

So depending on the Version of ORACLE you are using will depend the specific extension you activate and then the specific Instant Client that you also have to load onto the system running your Apache and PHP. 因此,根据您使用的ORACLE版本,将取决于您激活的特定扩展名,然后取决于还必须将特定的Instant Client加载到运行Apache和PHP的系统上。

Also you have to activate the generic 另外,您必须激活通用

;extension=php_oci.dll      

And one of the specific version extensions. 以及特定的版本扩展之一。

;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11gR2 Instant Client
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的异常'PDOException',消息'找不到驱动程序' - Uncaught exception 'PDOException' with message 'could not find driver' 致命错误:未捕获异常“PDOException”,消息“找不到驱动程序” - Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' 消息“找不到驱动程序”的异常“ PDOException” - exception 'PDOException' with message 'could not find driver' 未捕获的PDOException:找不到驱动程序 - Uncaught PDOException: could not find driver 使用Sqlite的消息“找不到驱动程序”的未捕获异常“ PDOException”:配置错误? - Uncaught exception 'PDOException' with message 'could not find driver' using Sqlite: mis-configuration? 异常'PDOException',消息'找不到驱动程序'SQLSRV Laravel Artisan CLI - exception 'PDOException' with message 'could not find driver' SQLSRV Laravel Artisan CLI PDO:未捕获的PDOException:找不到驱动程序 - PDO : Uncaught PDOException: could not find driver Symfony db交互; PDOException:找不到驱动程序 - Symfony db interaction; PDOException: could not find driver 使用AppServer的消息“找不到驱动程序”的“ PDOException” - 'PDOException' with message 'could not find driver' using AppServer PostgreSql 带有消息“找不到驱动程序”的“PDOException” - PostgreSql 'PDOException' with message 'could not find driver'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM