MariaDB/cPanel issue with 5.6.x sites

Whilst V9 is the latest and greatest, I know a lot of us have a few 5.6 sites still kicking about.

Today I’ve hit an issue where all of a sudden, I’m getting the error message:

Unable to connect to database.

A database error occurred while processing this request.

This is on PHP7.4, with the last release, 5.6.4.0, on cPanel, running MariaDB 11.x.
Debugging the error, my thinking here is that some update to MariaDB has changed the TLS handshake requirements, and the existing code just wouldn’t connect.

Fortunately I’ve been able to work out a trivial fix.

In /concrete/libraries/3rdparty/adodb/drivers/adodb-mysqli.inc.php, all that is needed is to comment out this foreach loop here on line 108:

That brings a site back up, and from a quick test everything is back to normal.

I thought it was worth posting here in case anyone else hits this issue, with cPanel likely rolling this update out automatically.

5 Likes