如何使用PHP 7连接到Oracle 11?

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

我已经安装了Client 11c,以及Oracle数据库。</ p>

我的PHP是使用以下配置构建的:</ p>

 < 代码> “ - 与-PDO-OCI = C:\ PHP-管理单元构建\ deps_aux \ ORACLE \ 64 \ instantclient_12_1 \ SDK,共享” 
</代码> </ PRE>

所以 我将即时客户端复制到此文件夹,并将其放入系统路径。</ p>

我仍然得到:</ p>

   PS C:\ php&gt;  php -m 
PHP警告:PHP启动:无法加载动态库'pdo_oci'(尝试:./ extdpp(无法找到指定的模块)。,。/ ext \ php_pdo_oci.dll(%1不是 有效的Win32应用程序。))在第0行的未知中
</ code> </ pre>

尝试使用display_startup_errors = on </ p>运行php -m时</ p>

我已经尝试下载其他PHP二进制文件并查看互联网的每个可能的角落。</ p>

任何人都可以帮我解决这个问题吗?</ p>

PS PDO是必须的。</ p>

提前致谢!</ p>
</ div>

展开原文

原文

The problem is, i have an application that the client demands it runs under Oracle DB.

I already have Client 11c installed, as well as Oracle Database.

My PHP was built using the following configuration:

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

So i copied the instant client to this folder, and put it in the system path as well.

Still i'm getting:

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

When trying to run php -m with display_startup_errors = on

I've tried download other PHP Binaries and looked up on every possible corner of the internet.

Can anyone help me solve this?

P.S. PDO is a must.

Thanks in advance!

douhulao7642
douhulao7642 正如在该问题上明确指出的那样,PDO是必须的。
2 年多之前 回复
dongzhan7909
dongzhan7909 php.net/manual/en/function.oci-connect.php
2 年多之前 回复

1个回答



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

展开原文

原文

Make sure your oracle client libraries are the same 32-bit or 64-bit architecture as PHP. Make sure whichever Oracle client libraries you want to use are first in PATH. If you use Instant Client you need to have the correct VS Redistributable, see http://www.oracle.com/technetwork/topics/winx64soft-089540.html or http://www.oracle.com/technetwork/topics/winsoft-085727.html

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐