【问题标题】:How can i connect to Oracle 11 using PHP 7?如何使用 PHP 7 连接到 Oracle 11?
【发布时间】:2018-07-12 21:28:40
【问题描述】:

问题是,我有一个客户端要求它在 Oracle DB 下运行的应用程序。

我已经安装了 Client 11c 以及 Oracle 数据库。

我的 PHP 是使用以下配置构建的:

"--with-pdo-oci=c:\php-snap-build\deps_aux\oracle\x64\instantclient_12_1\sdk,shared"

于是我把即时客户端复制到了这个文件夹,也放到了系统路径中。

我仍然得到:

PS C:\php> php -m
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: ./ext\pdo_oci (The specified module could not be found.), ./ext\php_pdo_oci.dll (%1 is not a valid Win32 application.)) in Unknown on line 0

当尝试使用 display_startup_errors = on 运行 php -m 时

我已尝试下载其他 PHP 二进制文件,并查看了互联网的每一个角落。

谁能帮我解决这个问题?

附: PDO 是必须的。

提前致谢!

【问题讨论】:

标签: php oracle pdo configuration instantclient


【解决方案1】:

确保您的 oracle 客户端库与 PHP 是相同的 32 位或 64 位架构。确保您要使用的 Oracle 客户端库位于 PATH 的首位。如果您使用 Instant Client,您需要拥有正确的 VS Redistributable,请参阅 http://www.oracle.com/technetwork/topics/winx64soft-089540.htmlhttp://www.oracle.com/technetwork/topics/winsoft-085727.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-10
    • 2016-01-21
    • 2020-09-20
    • 2018-03-10
    • 2017-06-17
    • 1970-01-01
    • 2020-07-30
    • 2023-03-23
    相关资源
    最近更新 更多