【发布时间】: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