Support

Site Restoration

#38433 Error 500: Could not instantiate mail function.

Posted in ‘Site restoration’
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

PHP version
8
CMS Type
Joomla!
CMS Version
3.10.11
Backup Tool Version
Backup Professional 8.2.6
Kickstart version
7.1.2

Latest post by nicholas on Tuesday, 07 February 2023 11:32 CST

CFM16

When I make a backup with the settings for one.com and restore it on another site ( also one.com) the front end seems to be working oke, but the backend gives after log inError 500: Could not instantiate mail function.

What can I do or have to change to avoid the error? On restoring backup I set the mail function Off.

 

nicholas
Akeeba Staff
Manager

You are getting the warning (it's not an error) because you have turned off email sending. When email sending is disabled and any core or third party extension tries to send an email Joomla raises a user-visible warning that the mail function cannot be instantiated. It's not the only case Joomla acts obviously wrong against expected or configured situations, so at least it's consistently inconsiderate.

As to what sending the email, my best guess would be the “Email this address on successful back-end login” and “Email this address on failed administrator login” options in the Web Application Firewall: https://www.akeeba.com/documentation/admin-tools-joomla/web-application-firewall.html#waf-configure-logging-reporting

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!

CFM16

I disbled securitycheck on backup so with restoring it would not send mails and one.com the error keeps coming.
Tried with basic htaccess still no success.

Put the backup and restoration on another hosting platform and now backend seems oke, but now frontend  gives 504 Gateway Time-out

nicholas
Akeeba Staff
Manager

Admin Tools may not be the only plugin which sends emails on your site. That said, this is a warning, not an error.

The other problem I see in the site whose URL you have provided in the ticket is that you have restored a Joomla 3 site on PHP 8.1 or later which is barely compatible with Joomla 3 and most definitely not compatible with most of its extensions (our extensions are a rare exception; we support all PHP versions from 7.4 to 8.1 inclusive for use with Joomla 3). If you want to see what is giving you an error in the frontend, edit the configuration.php file and set the debug line to public $debug = true; to turn on the site debugging information.

Basically, all the problems you have seem to come from differences in the PHP versions between the source and target site. Do keep in mind that Akeeba Backup CANNOT and WILL NOT rewrite the source code of Joomla and its installed extensions to magically make them compatible with the PHP version of the target server. You need to ensure that the PHP versions match when transferring your site.

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!

CFM16

Ok, thanks for the tips about same php version, I thought they were the same (8.0) but apparantley not.

Best regards
Pete

nicholas
Akeeba Staff
Manager

No worries! It happens to all of us :) In fact, it was happening to me so often that I have added the code to display the PHP version of the original site and the current server in the first page of the restoration script. Look towards the bottom right hand side of the page. I have caught a lot of self-inflicted issues when testing across different development servers and PHP versions.

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!

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!