【问题标题】:Unable to connect to data source: library 'gds32.dll' failed to load - Firebird Connection PHP odbc_connect无法连接到数据源:库“gds32.dll”加载失败 - Firebird Connection PHP odbc_connect
【发布时间】:2020-12-08 12:56:48
【问题描述】:

我正在尝试使用 PHP 连接到 Firebird 数据库。 这是我用来连接它的简单代码。

$user = "******";
$password = "******";
$ODBCConnection = odbc_connect("DRIVER={Firebird/InterBase(r) driver};Database=******;Server=******;Port=******", $user, $password);

我已经从这个网页https://www.firebirdsql.org/en/odbc-driver/ 安装了 Firebird 的 ODBC 驱动程序。我已经设法将正确的(我相信的)字符串添加到 ODBC 连接内的驱动程序,但现在我遇到了这个错误:

Warning: odbc_connect(): SQL error: [ODBC Firebird Driver]Unable to connect to data source: library 'gds32.dll' failed to load, SQL state 08004 in SQLConnect

我在 localhost 上使用 XAMPP 运行 Apache 服务器。我写的一切都在 index.php 文件中,只是试图连接到数据库。

任何帮助将不胜感激。

【问题讨论】:

  • 为什么不使用 Firebird PHP 驱动程序?无论如何,该错误意味着您已将数据源配置为使用 gds32.dll(而不是 fbclient.dll),并且该文件在您的系统上不存在。您是否安装了 Firebird 客户端库?
  • 你知道PHP Firebird驱动的名字吗?我可以尝试使用它,看看它是否有效。我安装了这个版本的 Firebird sourceforge.net/projects/firebird
  • 那是旧项目的位置(最后的文件是 2017 年的)。从firebirdsql.org 下载文件。您可以在 firebirdsql.org/en/php-driver(或 github.com/FirebirdSQL/php-firebird)找到 PHP 驱动程序。您仍然需要安装 Firebird 客户端库(例如使用 Firebird 3 安装程序),因为您需要为 ODBC 驱动程序安装。

标签: php database odbc firebird


【解决方案1】:

当您的系统上没有安装 Firebird 客户端库(fbclient.dll 或 gds32.dll 被尝试作为后备)(或者您安装了它,但它的位数错误)时,会发生此错误。

要安装 Firebird 客户端库,请使用正确位数*的 Firebird 服务器安装程序(例如 https://www.firebirdsql.org/en/firebird-3-0/ 的 Firebird 3 Windows 64 位),然后安装 客户端组件

也就是说,如果您使用的是 PHP,则改用 Firebird PHP driver 可能更有意义(尽管这仍需要安装 fbclient.dll)。


*: 正确位数:如果你使用 32 位 PHP,你需要 32 位客户端库,如果是 64 位,则需要 64 位客户端库。

【讨论】:

  • 好的。我现在确实安装了 PHP 驱动程序,将其包含在扩展中并将其添加到 php.ini 文件中。我还下载了firebird客户端。驱动程序的字符串将使用已添加到 PHP 中的字符串是什么?我似乎在 ODBC 驱动程序列表中找不到它。
  • 使用PHP驱动意味着你不需要使用ODBC,你会使用Firebird PHP驱动。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-11
  • 1970-01-01
  • 1970-01-01
  • 2019-03-08
  • 2020-05-05
  • 1970-01-01
相关资源
最近更新 更多