Support

Akeeba Backup for WordPress

#42152 Version 9.0.5 displays error about class-phpmailer.php

Posted in ‘Akeeba Backup for WordPress’
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

WordPress version
6.8.2
PHP version
8.3.23
Akeeba Backup version
9.0.5

Latest post by mattsson on Tuesday, 29 July 2025 15:45 CDT

mattsson

EXTREMELY IMPORTANT: Please attach a ZIP file containing your Akeeba Backup log file in order for us to help you with any backup or restoration issue. If the file is over 10MiB, please upload it on your server and post a link to it.

Hello Akeeba tech support,

In my last round of software updates of my WordPress websites, for the development websites with PHP error messages displayed, I'm seeing this new error message at the back end:

Deprecated: File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace. in /home/customer/www/wciv.eliza.tech/public_html/wp-includes/functions.php on line 6121

I can make the error message go away by deactivating Akeeba Backup Pro for WordPress.  And after some experimentation, I've determined that the message is NOT displayed for Akeeba Pro version 9.0.3 or 9.0.4, only 9.0.5.  I don't think the error message is affecting any functionality, as I think the backups complete OK, I think it's just annoying, because I can't log into the website back end unless error message display is turned off.

My workaround is to re-install Akeeba backup for WordPress pro version 9.0.4 via the Plugins > Add Plugin feature.

Researching this error message earlier, it seems to have started appearing for others about 5 years ago, related to a bug in this plugin: https://wordpress.org/support/plugin/wp-mail-smtp/.  But none of my websites use this plugin.

Let me know if you have questions or you'd like access to one of the mentioned websites.  They are both my standard plugin setup, with akeeba, wordfence, classic editor, gdpr cookie compliance, passwordProtected (use password "preview" to see the website front end).  I use Astra theme mostly (e.g. matt.eliza.pro) but am thinking of learning Elementor (elem.eliza.pro).

Can you help?  I'd like to keep my Akeeba backup plugins to the latest, but in my development websites I like to keep the error messages enabled so I can learn of potential problems early.

Sincerely, Carol Mattsson

Long time use of Akeeba Backup Pro for WordPress and Joomla

nicholas
Akeeba Staff
Manager

We had to include the legacy PHPmailer files instead of using their modern versions because a certain third party plugin was badly written and these people were falsely blaming us for "breaking their plugin" when it was, in fact, their own incompetence (they were relying in PHP's require_once to not include the same class twice instead of using class_exists). The downside is, of course, that WordPress emits a user warning message when these old files are included by a plugin.

This is normally not an issue on a properly configured production server. Anything below a stop error (E_ERROR) is not reported in the browser output, and actual stop errors are caught by WordPress itself. The user warnings are simply not output; they are only logged.

It is a problem in a server configuration like yours where the PHP error reporting level is set unnecessarily high. The correct thing to do on a production site is to set the PHP error reporting level to E_ERROR only. You do not want warnings, notices, and deprecation notices to be output. You can ask your host on how to do that. Usually, it's something you can set up in the hosting control panel.

As a mid-term solution I have made a modification in that code to suppress the browser output of WordPress' warnings. I will be releasing a new version of Akeeba Backup for WordPress this upcoming week.

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!

mattsson

Dear Nicholas,

Thank for explaining how these particular PHPmailer errors came to be. I believe your answer implies I don't need to worry about them, and I can adjust my web server configuration to see only E_ERROR level errors, on my development websites when I leave error message display enabled.

I can see that you have quite the balancing act of producing ONE version Akeeba Backup each release, that works in so many different WordPress configurations. The rest of my message seeks your general feedback on how to interpret the PHP warnings, notices, and deprecation notices I see at my development websites.

I think you're saying I don't need to be concerned about the PHP warnings, notices, and deprecation notices I see output at my development websites, when I leave error reporting enabled (debug mode). And that I can make my work life easier by adjusting my web host's server configuration to report only PHP E_ERROR level errors. You also note that the warnings etc. are likely logged in the server error log that I see available to me amongst the website files on the server, in case I really want to view them.

When I was a software developer I did like to see warnings etc. to help me write robust code. But now as an "integrator" of WordPress plugins and WordPress core code to create websites, do the warnings etc. provide any use to me?

I realize that if a website crashes, I do need to know what happened, and the E_ERROR level message displayed if I've configured my WordPress (development) website to show me errors, will be helpful.

I observe that without the PHP warnings, notices, and deprecation notices shown, I can still learn which plugins are going out of support, by the two types of notes the WordPress plugin repository provides about the plugins found there: It tells me if a plugin hasn't been tested with the latest version of WordPress (according to the developer); and it tells me when a plugin hasn't been updated in the last two-three years.

Gratefully ...

Carol Mattsson

nicholas
Akeeba Staff
Manager

I believe your answer implies I don't need to worry about them

Correct. These messages are not errors, they are user warnings.

They are not coming from a programming error that needs fixing, they are WordPress issuing a warning about using the legacy PHPmailer path instead of the modern one. I am aware of the change, but I have to still use the legacy path because of a third party plugin which breaks if I don't. Even though I am using the legacy path, I already have code in place to use the modern PHPmailer inclusion path in WordPress when WordPress removes the legacy path without me having to do anything else 😀

I can see that you have quite the balancing act of producing ONE version Akeeba Backup each release, that works in so many different WordPress configurations. 

And that's before you start considering the differences between PHP versions, MySQL vs MariaDB, and the different MySQL and MariaDB versions.

I think you're saying I don't need to be concerned about the PHP warnings, notices, and deprecation notices I see output at my development websites, when I leave error reporting enabled (debug mode).

Correct. As an end user you can't do anything about them. These are for us developers to see. Deprecation notices and notices give us a heads up about behavior in PHP which will or might change in the future. Warnings tell us that something didn't outright break, but it may cause side-effects or might break in the future. There's a LOT of nuance understanding what these mean, what we can do about them, and when to do something about them. If you run WordPress on PHP 8.4 you will get tonnes of deprecation notices. WordPress cannot address them properly before dropping support for PHP version older than 7.4. There's a reason they increase the minimum recommended PHP version every release and why they are dropping support for older PHP versions. They don't do it to annoy you, they do it to make sure you will have an upgrade path in 2-3 years' time.

I realize that if a website crashes, I do need to know what happened, and the E_ERROR level message displayed if I've configured my WordPress (development) website to show me errors, will be helpful.

About E_ERROR in particular, in PHP 7 and later versions it is thrown as an ErrorException which extends Throwable. Moreover, PHP does have a mechanism to intercept E_ERROR to run some code before it crashes out. WordPress has a default exception handler and an error handler which catch those errors to display a nice page informing the visitor something broke, and send you an email with the details of the error. This is MUCH more preferable than throwing an error to the browser. An error to the browser may contain privileged information which might leak information valuable to a potential attacker.

You can always extend the functionality of WordPress' error handler by handling the wp_php_error_message filter. You could write an mu-plugin to log extended debug information, or send that to a log management service like DataDog, a self-hosted Graylog image etc. You could even send you a conditional push notification if you're trying to troubleshoot an intermittent issue. I am using that trick to create a very detailed crash report during development.

It tells me if a plugin hasn't been tested with the latest version of WordPress (according to the developer); and it tells me when a plugin hasn't been updated in the last two-three years.

Sometimes a plugin is just too simple to warrant an update. This should also be a factor in your decision-making.

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!

mattsson

Dear Nicholas,

Thank you for your educational reply, confirming my ideas about how to respond to PHP warnings, notices and deprecation notices I see in my development websites when debug messages are enabled.

I also appreciate the note about how WordPress handles E_ERROR failures.

That's an Informative point, about sometimes a plugin being just too simple to warrant an update.

Thanks again and you may close this ticket.

--Carol Mattsson

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!