Roundcube install, getting MYSQL_ATTR_FOUND_ROWS fatal error

antonanton picture antonanton · May 14, 2013 · Viewed 9.3k times · Source

I'm installing Roundcube 0.9.0 on a shared host server.

I have PHP 5.3.8 with PDO activated however when i'm installing roundcube, this is what response I get:

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

I have contacted my host, they turned me away. I contacted Roundcube, they turned me away. Is there something I could be overlooking?

here is the PDO section of the code including the faulty line:

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;

Answer

Ryan Miller picture Ryan Miller · Jul 7, 2017

Just spent a few hours chasing this down. I am using PHP 5.3.3 with MySQL 15.1 (10.0.31 MariaDB) on Centos 6.5

For me, the fix was to obtain the mySQL-pdo so file. Fixed by performing yum install php-mysql-5.3.3-49.el6.x86_64. That package was chosen by performing yum whatprovides phppdo*.so

I was led down this path by: PHP 7 RC3: How to install missing MySQL PDO

This may be overkill - and please let me know if it is, but I also specified the extension in /etc/php.ini (line 925) extension=/usr/lib64/php/modules/pdo_mysql.so