IMAP and PHP 8.4: why WordPress email plugins break, and what to do
Short answer
PHP 8.4 moved the IMAP extension out of PHP (to PECL). Plugins that read mailboxes with imap_open() and the other imap_* functions, such as help desks, email-to-post or bounce handlers, stop with “Call to undefined function imap_open()” on a server whose PHP 8.4 doesn’t have IMAP installed separately. Before switching, ask your host whether IMAP will be available for PHP 8.4, and check which plugins use it. Otherwise stay on 8.3 for now, or move the plugin to a newer mail method.
What changed in PHP 8.4
php.net lists the extensions that left PHP with version 8.4, IMAP among them, which “have been moved to PECL and are no longer part of the PHP distribution” (php.net): IMAP, OCI8, PDO_OCI and PSpell. PECL is where PHP extensions that aren’t part of PHP itself are published; a host can still install them, but they no longer come with PHP.
What happens on the server
We ran the same check on the official PHP builds. The PHP 8.3 build still includes IMAP as an extension:
wp-content/plugins/mail-inbox/mail-inbox.php
<?php
echo function_exists('imap_open') ? 'IMAP available' : 'IMAP missing', "\n";
IMAP availableThe PHP 8.4 build doesn’t include it, so the function doesn’t exist, and a plugin that calls it stops:
wp-content/plugins/mail-inbox/mail-inbox.php
<?php
echo function_exists('imap_open') ? 'IMAP available' : 'IMAP missing', "\n";
$inbox = imap_open('{mail.example.com:993/imap/ssl}INBOX', 'user', 'password');
IMAP missing
Fatal error: Uncaught Error: Call to undefined function imap_open() in /var/www/html/wp-content/plugins/mail-inbox/mail-inbox.php:3
Stack trace:
#0 {main}
thrown in /var/www/html/wp-content/plugins/mail-inbox/mail-inbox.php on line 3On a WordPress site that means “There has been a critical error on this website.” on every page that loads that code, and often the plugin’s background task (checking the mailbox) fails silently in WP-Cron.
Which plugins are affected
Plugins that read email: help-desk and ticket plugins, plugins that turn emails into posts or comments, bounce and reply handlers, some newsletter tools. Plugins that only send email are not affected: WordPress sends mail with its own functions, not IMAP.
Before you switch to PHP 8.4
- List the plugins that read a mailbox: their settings ask for an IMAP or POP3 server.
- Ask your host whether IMAP will be installed for PHP 8.4 on your server.
- Ask the plugin’s developer whether a version without the
imap_*functions exists, or is planned. - If neither: stay on PHP 8.3 (security fixes until 31 December 2027) while you replace the plugin, or move the mailbox reading to a service the plugin supports.
Note what a code check can and can’t tell you here: the imap_* calls are ordinary code, and whether they work depends on what your server has installed, not on the PHP version alone. CompatNav doesn’t flag them for PHP 8.4. The decisive check is the extension on your server, and your host is the one to ask. The rest of the PHP 8.4 changes are in WordPress and PHP 8.4; other missing extensions show up in Site Health’s module check.
Key takeaways
- IMAP, OCI8, PDO_OCI and PSpell are no longer part of PHP 8.4; they can be installed separately from PECL.
- Without it,
imap_open()is a fatal error: “Call to undefined function imap_open()”. - Plugins that read mailboxes (help desks, email-to-post, bounce handling) are the ones affected.
- Ask your host whether IMAP will be available for PHP 8.4 before you switch.
- Sending email from WordPress doesn’t use IMAP: contact forms and notifications are not affected.
Frequently asked questions
Does PHP 8.4 break sending email from WordPress?
No. WordPress sends email with its own mail functions (or an SMTP plugin), not IMAP. Only plugins that read a mailbox use IMAP.
Can my host still offer IMAP on PHP 8.4?
Yes, by installing the extension separately from PECL. Many hosts decide per server; ask yours before switching.
How do I know if a plugin uses IMAP?
Its description or settings usually mention reading a mailbox (IMAP or POP3). In its code, look for functions starting with imap_. Site Health doesn’t list IMAP among its checks.
Check your own site before you upgrade
CompatNav is a free WordPress plugin. It reads the code of your plugins and themes on your own server and tells you, in plain words, what will break and what will only show notices on the PHP version you choose. It never changes your code. It can’t see problems that only appear while code runs with real data, so a quick check of your site after the upgrade still matters.
Sources
About the code examples: each output is the real output of the code shown, run with the official PHP builds, without a php.ini, with all errors reported and displayed. Only the file path was replaced by a neutral server path.