Opened 11 years ago
Closed 4 years ago
#25253 closed defect (bug) (wontfix)
Fatal error: Cannot redeclare class phpmailerException
Reported by: | hovida | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.6 |
Component: | Keywords: | has-patch needs-testing | |
Focuses: | Cc: |
Description (last modified by )
All Plugins Disabled, all Themes disabled - Reinstalled - All the same error:
http://www.tinnitus-coach.eu/wp-login.php?action=lostpassword
Fatal error: Cannot redeclare class phpmailerException in /homepages/23/d471228603/htdocs/wp-includes/class-phpmailer.php on line 2825
Same Problem when i use wp_mail on Cron shedules, see:
http://wordpress.org/support/topic/wp-cronphp-wp_mail-not-working?replies=2#post-4626751
Attachments (1)
Change History (8)
#1
@
11 years ago
- Component changed from Accessibility to Mail
- Description modified (diff)
- Summary changed from PHPMailer to Fatal error: Cannot redeclare class phpmailerException
#2
@
11 years ago
- Keywords reporter-feedback added; needs-patch removed
#3
@
9 years ago
- Keywords reporter-feedback removed
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
Closing as worksforme. Feel free to reopen if you can provide steps to reproduce
#4
@
9 years ago
- Resolution worksforme deleted
- Status changed from closed to reopened
Was able to reproduce this problem using a global error handler that included its own phpMailer script. Pluggable.php does check if the $phpmailer global is defined, but not whether the base class exists (which would mean it's been included, but not initialized). Submitting a patch.
#7
@
4 years ago
- Resolution set to wontfix
- Status changed from reopened to closed
As of WordPress 5.6, PHPMailer has been brought up to date with the upstream library (see #41750). Because this is the only report I can find for this error, I'm going to close this out as a wontfix
.
Adding the extra safety check probably wouldn't hurt, but an external script loading its own version of PHPMailer could have other undesirable side effects. For example, if an older version of the library is loaded outside of WordPress and Core utilizes a newer feature within the library, that would potentially cause issues. Leaving this error could potentially help debug the issue so that improvements can be made.
If there are any factors being missed that should be considered, feel free to reopen this and add additional details.
Could not reproduce the issue neither with the password reset form nor with your plugin from the forum topic, it works fine for me.
The only place in core where
class-phpmailer.php
in included iswp_mail()
, but it first checks if$phpmailer
global is defined, and it usesrequire_once
rather than justrequire
: tags/3.6/wp-includes/pluggable.php#L223.I can only reproduce this fatal error if I manually include
class-phpmailer.php
twice outside ofwp_mail()
.