You install a plugin, upload a new script, or bump PHP to a newer version, and the site dies with something like Fatal error: Uncaught Error: Call to undefined function mb_strlen(). Nothing in your code changed. The server just doesn't have a piece of PHP that your site expects. This guide shows how to read that error, find the missing extension, and switch it on in cPanel or on a VPS.

What the error looks like

The wording varies by extension, but they all share a pattern: PHP is asked to run a function or class it was never compiled or configured with.

  • Call to undefined function mb_strlen() → the mbstring extension is off.
  • Call to undefined function curl_init() → curl is off.
  • Class 'ZipArchive' not found → zip is off.
  • Class 'DOMDocument' not found or Call to undefined function simplexml_load_string() → dom / xml / simplexml.
  • Call to undefined function imagecreatefromjpeg() → gd.
  • Call to undefined function mysqli_connect() → mysqli (or nd_mysqli).
  • WordPress Site Health says "The optional module, intl, is not installed".

On WordPress you'll often get a white screen or "There has been a critical error on this website" instead of the raw message. The real text is in the log, which we'll get to.

Why it happens

A few common causes:

  1. You changed PHP versions. Each PHP version in cPanel has its own extension list. Switching from 8.1 to 8.3 can quietly turn off something you relied on.
  2. A plugin or app needs something new. Image optimisers want imagick or gd, multilingual plugins want intl, backup plugins want zip.
  3. Fresh VPS. A minimal PHP install on Ubuntu or AlmaLinux ships only a few modules. The rest are separate packages.
  4. Wrong PHP binary. You enabled the extension for one PHP version, but the site actually runs on another.

Step 1: Confirm which extension is missing

Don't guess. Check the PHP error log. In cPanel, open Metrics → Errors or look for the error_log file in the site's folder in File Manager. The last lines will name the function or class.

Then confirm what PHP your site really uses. Create a temporary file called info.php in the site root:

<?php phpinfo();

Open it in a browser and check the version at the top and the "Loaded Configuration File" path. Search the page for the extension name. If it isn't listed, it isn't loaded. Delete info.php straight afterwards; it exposes a lot about your server.

Step 2: Enable it in cPanel

On shared and reseller hosting this takes about a minute.

  1. Log in to cPanel and open Select PHP Version (some accounts show MultiPHP Manager and MultiPHP INI Editor instead; see the note below).
  2. Make sure the version at the top matches the one your domain uses.
  3. Open the Extensions tab.
  4. Tick the box next to the missing extension (for example mbstring, zip, intl, imagick).
  5. Wait for the "saved" confirmation, then reload your site.

If you only see MultiPHP Manager and no extension list, your account is on the system PHP profile. Open a ticket with the extension name and PHP version and we'll enable it server-side. Some extensions can't be switched on by the account holder.

Changes usually apply immediately. If they don't, clear OPcache by toggling the PHP version off and on, or ask support to restart PHP-FPM for your account.

Step 3: Install it on a VPS

On your own server you install the package, then restart the PHP service. First find your PHP version:

php -v
php -m | grep -i mbstring

Ubuntu / Debian (example for PHP 8.3):

sudo apt update
sudo apt install php8.3-mbstring php8.3-curl php8.3-zip php8.3-xml php8.3-gd php8.3-intl
sudo systemctl restart php8.3-fpm
sudo systemctl restart nginx    # or apache2

AlmaLinux / Rocky (Remi PHP):

sudo dnf install php-mbstring php-curl php-zip php-xml php-gd php-intl
sudo systemctl restart php-fpm
sudo systemctl restart nginx    # or httpd

On a WHM/cPanel VPS, use WHM → EasyApache 4 → Customize, search the PHP Extensions list, toggle the module, and provision. That keeps cPanel's own tooling in sync.

PECL extensions (imagick, redis, memcached)

Some extensions aren't in the base repo. Prefer the distro package first (php8.3-imagick, php8.3-redis). Only reach for pecl install if no package exists, because compiled-by-hand modules get forgotten during PHP upgrades.

Step 4: Verify it worked

Don't trust the green tick. Test it:

php -m | grep -i zip
php -r "var_dump(function_exists('mb_strlen'));"

Remember the CLI can use a different php.ini than the web server. A module showing in php -m but not in the browser's phpinfo() means FPM or Apache hasn't reloaded, or the site runs a different PHP version. Always make the final check in the browser.

Common mix-ups

SymptomLikely causeFix
Enabled it, error persistsWrong PHP version selectedMatch the version in Select PHP Version to the domain's version in MultiPHP Manager
Works in SSH, not in browserCLI and FPM use different ini filesRestart PHP-FPM and check phpinfo()
Extension missing from listNot built for that PHP versionTry another PHP version or ask support
Subdomain still failingSubdomain has its own PHP versionSet the version per domain in MultiPHP Manager
Site broke after upgradeNew version starts with defaultsRe-tick every extension you used before

Prevention

  • Before changing PHP versions, open Extensions on the old version and note what's enabled. Match it on the new one.
  • Read plugin requirements before installing. Most list required PHP extensions on their page.
  • Use a staging copy to test PHP upgrades. Our WordPress staging guide covers the cPanel route.
  • Check WordPress Site Health (Tools → Site Health → Info) now and then. It flags missing optional modules before they cause a crash.
  • On a VPS, keep a short install script of your PHP packages so a rebuild doesn't lose them.

Frequently Asked Questions

Is it safe to enable every extension?

Not a good idea. Each loaded module uses a little memory and widens the attack surface. Enable what your site needs and leave the rest off.

I enabled the extension but WordPress still shows the old error. Why?

Usually it's the wrong PHP version, or cached state. Confirm the domain's PHP version in MultiPHP Manager, then check phpinfo() in the browser. If it's still absent, ask support to restart PHP-FPM.

Can I add an extension that isn't in the cPanel list?

On shared hosting, no, since the server owns the PHP build. Contact support with the extension name and PHP version and we'll tell you whether it can be added. On a VPS you can install it yourself.

Why did this start right after I upgraded PHP?

Every PHP version keeps its own extension settings. A new version doesn't inherit the old one's choices, so you have to re-enable them.

Do I need to delete phpinfo afterwards?

Yes. Remove info.php as soon as you've read what you need. Leaving it public reveals paths, versions and settings to anyone who finds it.