Support

Akeeba Backup for Joomla!

#30887 Unhandled exception mysqli_real_escape_string()

Posted in ‘Akeeba Backup for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Akeeba Backup version
n/a

Latest post by cystophora on Wednesday, 06 February 2019 20:46 CST

cystophora
Hi, i've searched through the other tickets but can't seem to find the same one.

I'm getting this error:

Akeeba Backup - An unhandled Exception has been detected
500 Call to undefined function Akeeba\Engine\Driver\mysqli_real_escape_string()

File <root>/administrator/components/com_akeeba/BackupEngine/Driver/Mysqli.php Line 150

This happened after our host upgraded from php 5.something to 7.1

Any help would be much appreciated, thanks

nicholas
Akeeba Staff
Manager
Please open Joomla's configuration.php file, located in the site's root, with a text editor. Find the $dbtype line. Look at the right hand of the equals sign, inside the single quotes. If that contains mysql please change it to pdomysql

Why you have to do that. Old versions of Joomla! would by default install using the 'mysql' database driver. This is an old database driver deprecated with PHP 5.3 and made obsolete (removed) in PHP 7.0. The recommended driver changed to 'mysqli' which is newer and better. There is a third driver 'pdomysql' which uses the PHP Data Objects (PDO) extension for PHP. This is considered an even better, if more cumbersome, alternative.

Your site very likely had the old 'mysql' driver. This means that upon upgrade to PHP 7 your site would immediately break. Joomla! tries to prevent that by understanding that using the nonexistent 'mysql' driver under PHP 7 really means using the 'pdomysql' driver. Therefore it internally uses the 'pdomysql' driver BUT reports to its extensions that it's using the 'mysql' driver.

Akeeba Backup sees that Joomla is using the 'mysql' driver on PHP 7 which is, of course, impossible. However, Akeeba Backup's default fallback in this case is 'mysqli', not 'pdomysql'. This has to do with compatibility with some third party extensions, such as Falang, which do weird things with the database driver. The problem is that your host has not enabled the 'mysqli' driver on PHP 7.1, thus causing Akeeba Backup to fail.

By changing your configuration.php file to use 'pdomysql' you are essentially giving Akeeba Backup the hint to use the correct database driver itself, therefore fixing the problem you have.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

cystophora
Thank you Nicholas, that was very easy and took me 2 minutes. My host quoted $225 to fix it (this is very typical of them) haha

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!