Roundcube 安装,出现 MYSQL_ATTR_FOUND_ROWS 致命错误

ant*_*ton 6 php pdo fatal-error roundcube

我正在共享主机服务器上安装 Roundcube 0.9.0。

我有 PHP 5.3.8 并激活了 PDO,但是当我安装 roundcube 时,这是我得到的响应:

Check DB config
Fatal error: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS' in /home/neuas/domains/anthonysalvador.info/public_html/webmail/program/lib/Roundcube/rcube_db_mysql.php on line 127
Run Code Online (Sandbox Code Playgroud)

我已经联系了我的房东,他们拒绝了我。我联系了 Roundcube,他们拒绝了我。有什么我可以忽略的吗?

这是代码的 PDO 部分,包括错误行:

102    protected function dsn_options($dsn)
103    {
104    $result = array();
105
106    if (!empty($dsn['key'])) {
107        $result[PDO::MYSQL_ATTR_KEY] = $dsn['key'];
108    }
109
110    if (!empty($dsn['cipher'])) {
111        $result[PDO::MYSQL_ATTR_CIPHER] = $dsn['cipher'];
112    }
113
114    if (!empty($dsn['cert'])) {
115        $result[PDO::MYSQL_ATTR_SSL_CERT] = $dsn['cert'];
116    }
117
118    if (!empty($dsn['capath'])) {
119        $result[PDO::MYSQL_ATTR_SSL_CAPATH] = $dsn['capath'];
120    }
121
122    if (!empty($dsn['ca'])) {
123        $result[PDO::MYSQL_ATTR_SSL_CA] = $dsn['ca'];
124    }
125
126    // Always return matching (not affected only) rows count
127    $result[PDO::MYSQL_ATTR_FOUND_ROWS] = true;
Run Code Online (Sandbox Code Playgroud)

小智 3

我知道这是一个较旧的主题,但我在寻找同一问题的解决方案时发现了它。这对我有用。我使用文本编辑器打开 db.inc.php 并查看第 25-28 行,然后取消注释并编辑适用于我的安装的行。这删除了错误消息并且安装完成。

//$rcmail_config['db_dsnw'] = 'mysql://roundcube:pass@localhost/roundcubemail';
// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';
// Warning: for SQLite use absolute path in DSN:
// sqlite example: 'sqlite:////full/path/to/sqlite.db?mode=0646';
Run Code Online (Sandbox Code Playgroud)