php:加载oracle驱动程序会显示错误“无法加载动态库-找不到指定的过程." [英] php: loading oracle driver gives error "Unable to load dynamic library - The specified procedure could not be found."

查看:478
本文介绍了php:加载oracle驱动程序会显示错误“无法加载动态库-找不到指定的过程."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎对PHP有一个奇怪的问题.

I seem to have a strange problem with PHP.

我已经将一堆软件从一台服务器迁移到另一台服务器.在服务器上,一些脚本建立了与Oracle的连接,因此能够建立连接的是oracle客户端,并且已安装tnsnames文件.来自sql * plus的连接有效.

I've migrated a bunch of software from one server to another. On the server some scripts make a connection to Oracle, so to be able to make a connection the oracle client is installed and a tnsnames file is in place. Connection from sql*plus works.

某些脚本使用PDO,为此,我在php.ini中启用了extension = php_pdo_oci.dll.这些脚本的工作原理很简单.

Some of the scripts use PDO, so for that I've enabled extension=php_pdo_oci.dll in php.ini. These scripts work like a charm.

其他一些脚本使用诸如oci_connect之类的功能,并且这些脚本需要诸如php_oci8.dll之类的扩展名.借助xammp(我用作apache/php/mysql捆绑包)交付了php_oci8_12c.dll,所以我认为扩展名就足够了.

Some other scripts use functions like oci_connect, and these need a extension like php_oci8.dll. With xammp (that I use as apache/php/mysql bundle) php_oci8_12c.dll is delivered, so I thought that extension would be adequate.

启动服务器时,我在php错误日志中看到以下错误:

When starting the server, I see these errors in the php errorlog:

Unable to load dynamic library 'C:\xampp\php\ext\php_oci8_12c.dll' - The specified procedure could not be found.

该文件位于C:\ xampp \ php \ ext \中,所以应该没有问题.拾取相同目录中的其他扩展名不会出现任何问题.我还尝试加载php_oci8.dll,直到我从旧服务器上取回,但是却遇到了完全相同的问题.

The file is in located in C:\xampp\php\ext\, so that shouldn't be a problem. Other extensions that are in the same dir are picked up without any problems. I've also tried to load php_oci8.dll, wich I picked up from the old server, but got exactly the same problem.

对于一些我尝试失败的类似问题,我发现了一些答案: -将dll复制到c:\ windows \ system -将php ext dir添加到系统PATH变量中 -将oracle客户端添加到系统PATH变量中(已经在其中)

Some answers I found to similar problems I tried without success: - copying the dll to c:\windows\system - adding the php ext dir to the system PATH variable - adding the oracle client to the system PATH variable (was already in there)

我正在使用的软件版本:

The software versions I'm using:

  • 操作系统:Windows 2012 R2 x64
  • PHP:5.6.3
  • Oracle数据库:11.2.0.4.0

有什么想法吗?

推荐答案

似乎我已经弄清楚了,可以回答我自己的问题.看起来XAMPP随其分发版交付了不合适的ddl. 可以从所有可能的版本中下载正确的最新oci8 dll: http ://windows.php.net/downloads/pecl/releases/oci8/2.0.8/.一旦找到正确的,它就会像魅力一样发挥作用.

Seems like I figured it out and can answer my own question. It looks like XAMPP is delivering a non-suitable ddl with their distribution. The right and most recent oci8 dll's are downloadable here in all possible flavors: http://windows.php.net/downloads/pecl/releases/oci8/2.0.8/. Once I got the right one, it worked like a charm.

这篇关于php:加载oracle驱动程序会显示错误“无法加载动态库-找不到指定的过程."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆