How to enable a PHP extension
Most PHP extensions are a checkbox away in your control panel — here is where to find it and what to do when one is missing.
A PHP extension adds a capability the language does not have on its own — talking to a particular database driver, processing images, handling a specific data format. Applications that need one usually say so plainly, either in an installer error ("the gd extension is required") or in their documented requirements, so the first job is confirming which one you are actually missing before changing anything.
Where extensions are managed on shared hosting
On shared hosting, extensions are switched on and off from the PHP settings area of your control panel rather than by installing anything yourself. The list shows every extension available on the platform with a toggle or checkbox next to each, scoped to the PHP version currently assigned to that site — which is one reason the same extension can appear available under PHP 8.2 and missing under PHP 7.4: build sets differ between versions, and an old version may simply never have shipped it.
If you cannot find an extension you expect, confirm which PHP version the site is running before assuming the extension is unavailable — see checking your PHP version. The extension list you are looking at may belong to a different version than the one actually serving requests.
Confirming an extension is loaded
After switching an extension on, confirm it actually took effect rather than assuming the checkbox alone did the job — some panels apply the change immediately, others only on the next request or after a short delay. The most direct check is a one-line script:
<?php var_dump(extension_loaded('gd'));
Replace gd with the extension name your application asked for. This returns true or false straight from the running PHP process, which is a more reliable answer than the panel's own display if you have any doubt. A full phpinfo() dump, covered in how to check your PHP version, lists every loaded extension along with its version and any compile-time options — remove the script once you are done reading it.
Extensions that are commonly requested
| Extension | What it is for |
|---|---|
gd or imagick | Resizing and processing images — thumbnails, watermarks, image uploads. |
curl | Making outbound HTTP requests to other services and APIs. |
mbstring | Handling text correctly when it is not plain ASCII — required by most modern frameworks. |
zip | Reading and writing zip archives, often needed by installers and update systems. |
intl | Locale-aware formatting of dates, numbers and currency. |
opcache | Caches compiled PHP for faster execution — see what OPcache is. |
Working out which extension an error is asking for
Most installer and framework errors name the extension directly, but the wording varies enough to cause confusion:
- "Class 'ZipArchive' not found" means the
zipextension is missing. - "Call to undefined function curl_init()" means
curlis missing. - "The intl extension is missing" or a complaint about locale formatting means
intl. - Composer refusing to install a package over a
requireline listing an extension incomposer.json(shown asext-something) means exactly that extension by name, with the leadingext-stripped off.
Once you have the exact name, go back to the PHP settings area of your control panel, switch it on for the correct PHP version, and re-run whatever install step reported the error.
When an extension genuinely is not available
Occasionally an application asks for something the shared hosting platform does not offer at all — an unusual database driver, a specialised image codec, or a PECL extension that has to be compiled from source. On shared hosting there is no way to compile and install a custom extension yourself, because that requires root access to the server, which shared accounts do not have.
If your application's documentation lists an extension by name and it does not appear anywhere in your control panel's PHP settings under any available version, contact support to confirm whether it can be added to the platform. If it genuinely cannot — usually because it is unusual, unmaintained, or requires custom compilation — a VPS gives you full control over the PHP build and lets you install exactly what the application needs.
After enabling an extension
Some applications cache their own detection of what is available — a framework's dependency check, or a plugin that tested for the extension once during installation and stored the result. If the application still reports the extension missing after you have confirmed it is loaded, clear the application's own cache before assuming the PHP-level change failed.
If you are enabling extensions as part of a wider move to a newer PHP version, our guide to upgrading PHP safely covers testing the whole change on a copy of the site before switching the live one over. It is worth doing that check every time you move version, not just the first time an extension goes missing — a build that included an extension under one release can legitimately drop it in a later one, and the only way to find out before your visitors do is to look.
Related reading
A one-line PHP script and the PHP settings screen in your control panel both show the exact version your site runs on.
How to upgrade PHP without breaking your siteCheck compatibility, test on staging, then switch the live version over — the order that keeps a PHP upgrade from taking your site down.
What is PHP-FPM and why does it matter?The process manager that runs PHP behind most modern hosting stacks, and the reason your host almost certainly already uses it.
How to call an external API from PHPcURL, an authentication header and a decoded JSON response — the three parts of calling any external API from a PHP script.