douyingp82418 2015-10-23 10:46
浏览 61

php 5.6.13,PDO,连接到interbase失败(Debian GNU / Linux 7.7(wheezy))

I can connect to my interbase using IBConsole using the same user/pass as I use in php

php --version

PHP 5.6.13-0+deb8u1 (cli) (built: Sep  7 2015 13:38:37)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

Installed interbase: apt-get install libapache2-mod-php5 php5-interbase

phpinfo() returns:

Firebird/InterBase Support: dynamic
Compile-time Client Library Version: Firebird API version 25
Run-time Client Library Version LI-V6.3.3.26778: Firebird 2.5
PDO drivers enabled: firebird, mysql
PDO_Firebird, PDO Driver for Firebird: enabled
Firebird driver for PDO: Ard Biesheuvel

php test 1:

$host = 'MYSRV1:C:\folder\dbhms.ib';
$username = 'dbuser';
$password= 'dbpassword';
$conStr = "firebird:dbname={$host};User={$username};Password={$password};Port=3050;"; 
$DB = new PDO($conStr);
result:
PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [335544472] Your user name and password are not defined. Ask your database administrator to set up a Firebird login.' in /home/tr/ibase/test.php:29

php test 2:

print_r(PDO::getAvailableDrivers());
result:
;Array
(
    [0] => firebird
    [1] => mysql
)

Php documentation for PDO::getAvailableDrivers on http://php.net/manual/en/pdo.getavailabledrivers.php:

print_r(PDO::getAvailableDrivers());
result:
Array
(
    [0] => mysql
    [1] => sqlite
)

I notice that there is a leading ';' in my test 2 (;Array ) but it should not cause any trouble

What am I missing?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向