php pdo_informix on rhel6 - 未实现可选功能

php pdo_informix on rhel6 - Optional feature not implemented

我已经配置 pdo_informix:

[root@cc-allplus nginx]# php -i |egrep "pdo|PDO"
PDO
PDO support => enabled
PDO drivers => sqlite, sqlite2, odbc, pgsql, informix, dblib
pdo_dblib
PDO Driver for FreeTDS/Sybase DB-lib => enabled
pdo_informix
pdo_informix support => enabled
PDO_ODBC
PDO Driver for ODBC (unixODBC) => enabled
pdo_pgsql
PDO Driver for PostgreSQL => enabled
Revision =>  $Id: pdo_pgsql.c 300351 2010-06-10 12:11:19Z iliaa $
pdo_sqlite
PDO Driver for SQLite 3.x => enabled

并尝试建立连接:

try{

    $dbh = new PDO ("informix:host=some.example.ru; service=50000; database=test; server=test_net; protocol=onsoctcp;DB_LOCALE=en_US.57372; CLIENT_LOCALE=en_US.57372;", "dcs_test", "********");

    }catch (PDOException $e){
        echo 'Failed to execute your db connection: '. $e->getMessage().'</br>'; exit;
    }

响应是:

Failed to execute your db connection: SQLSTATE=HY000, SQLSetConnectAttr: -11097 [Informix][Informix ODBC Driver]Optional feature not implemented

谷歌搜索没有帮助解决这个问题。欢迎提出任何建议

问题已解决。 对于那些可能在使用 informix 或其他 pdo 库时遇到同样问题的人,我想分享一下。

我的麻烦在于选择最新版本的 PDO_INFORMIX soursec。根据我的搜索发现,php 5.3 需要 informix 不晚于 1.2.6 版本。

我从一篇 匈牙利语文章 中发现了该信息,这是唯一 post 关于 php 和 [=10= 之间的这种不兼容性] 在整个 www。

在 IBM 站点和 pdo PECL 源站点上都没有任何此类信息的字符串。上帝啊,这花了我几天时间,但我做到了!

在找到正确的版本后,我不得不重新编译 php,因为它已将 1.3.0 版本的 informix pdo 放入缓存中并且不想使用旧版本。

希望对您有所帮助!