php连接firebird

作者: zengde 分类: 笔记 发布时间: 2021-12-13 03:16

先下载php driver

Firebird: PHP Driver (firebirdsql.org)

把firebird安装目录的fbclient.dll复制到windows/system32/

在php.ini中加入

extension=php_interbase-nts.dll
extension=php_pdo_firebird.dll

示例:

$host = 'firebird:dbname=127.0.0.1:d:/firebird/TEST.FDB';
$password = '12345';
$username = 'SYSDBA';
      
$firebird = new \PDO($host, $username, $password, [\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION]);