You see a "Fatal error: Class not found" error and don't know which PHP extension is active on your hosting
Your script throws an error like Class 'IntlDateFormatter' not found or Call to undefined function mysqli_connect(). WordPress shows a white screen and the error log points to PHP Fatal error: Uncaught Error: Call to undefined function. Before contacting support, you need to know exactly which extensions are active on your hosting and which ones are missing. This article shows you the precise method to check.
The phpinfo() file; the fastest way to see the list of active extensions
Create a text file named info.php and put these three lines inside it:
<?php
phpinfo();
?>
Upload the file to public_html and open https://yourdomain.com/info.php in your browser. You'll see a long page with multiple tables. Ignore the PHP Credits section. Look for the Configure Command section; its output looks like this:
'./configure' '--with-mysqli' '--with-curl' '--enable-gd' '--with-openssl'
This line shows which extensions were enabled when PHP was compiled. But not all extensions are compiled this way; some like opcache and Zend OPcache are seen separately in the Loaded Configuration File and Scan this dir for additional .ini files sections.
After checking, delete the file. This is where people make a mistake: they leave the info.php file on the hosting and forget about it. This file shows all PHP configuration details including the path to configuration files and environment variables. Anyone who guesses the URL will see a complete map of your server. After you're done, delete the file.
Command-line command for faster checking
If you have SSH, this command gives you the list of all loaded extensions:
php -m
The output includes extension names on each line. To check for a specific extension:
php -m | grep -i intl
If the output is empty, the extension is not installed. To see the PHP version and the path to the configuration file:
php -v
php --ini
The php --ini command shows the path to the Loaded Configuration File and the Scan for additional .ini files directory. Active extensions usually have a separate .so file in that directory.
Checking for a specific extension without having SSH
Most shared hosting plans don't have SSH. In this case, use the phpinfo() file and press Ctrl+F on the result page to search for the extension name. If the extension name appears in the Configure Command section or as a standalone section with its own settings, it's active.
Second method: create a test file with this content:
<?php
var_dump(extension_loaded('intl'));
var_dump(function_exists('mysqli_connect'));
?>
An output of bool(true) means the extension or function exists. bool(false) means it's missing. This method is more accurate than searching text in phpinfo(), because some extensions like PDO are enabled by default but appear in the php -m output under a different name like pdo_mysql.
The difference between an installed extension and an active extension
An extension can be compiled on the server but disabled in the php.ini file. A line like ;extension=intl.so with a semicolon at the beginning means it's disabled. On shared hosting, you usually can't modify php.ini, but some control panels like cPanel allow you to select the PHP version and enable extensions from the Select PHP Version section. If you have this option, check the box for the extension you need and save.
This is where people make a mistake: assuming an extension that was on the previous hosting is also on the new hosting
The most common error I've seen: someone migrates their site from old hosting to new hosting and the script throws Fatal error: Uncaught Error: Call to undefined function mb_strlen(). The mbstring extension was active on the old hosting but isn't on the new one. Transferring files and database has nothing to do with PHP extensions. Each hosting has its own independent configuration.
Signs of this problem: the site worked fine on the old hosting, but after migrating to the new hosting it shows a white screen or a 500 error. The error log usually points to a specific function or class that is undefined. Solution: first check which extension is missing using the methods above, then request it from the new hosting's support.
The path to requesting an extension that isn't on your hosting
Common extensions like mysqli, curl, gd, mbstring, xml, and zip are active on most Linux hosting plans. Less common extensions like intl, imagick, redis, or sodium might not be available.
Before requesting, check these points:
- Is the extension really necessary for running your script? Some libraries like
DomDocumenthave alternatives. - Is your PHP version compatible with the extension? An extension compiled for PHP 7.4 won't work on PHP 8.2.
- Is the extension in your hosting provider's list of supported extensions?
Submit your request through a support ticket. Write the exact extension name, the required PHP version, and the reason you need it. If your script has official documentation, include the link as well. Support usually responds within a few hours, but installing heavy extensions like imagick may require a service restart and take more time.
If your need is urgent and the shared hosting can't install the extension, you have two options: upgrade to a dedicated server where you have full control over the PHP configuration, or change your script to use a library that works with the available extension. The first option costs money, the second takes time. I would choose a dedicated server when the extension is critical and the project is growing; when only one specific function is missing, changing the code is cheaper.
Checking extensions on ServerNet Linux hosting
On ServerNet Linux hosting, basic extensions like mysqli, curl, gd, mbstring, xml, zip, and opcache are enabled by default. To see the exact list, use the phpinfo() method described above. If you need an extension that isn't in the list, submit a support ticket and write the exact extension name. Common extensions are usually installed the same day.
Before requesting, check the ServerNet knowledge base documentation; maybe your question has already been answered. If you encounter a white screen error, read the guide on fixing white screens in WordPress and PHP. To check whether the problem is DNS-related, use the DNS and network checking tool.
Comparison table: methods for checking PHP extensions
| Method | Required access | Accuracy | Time |
|---|---|---|---|
| phpinfo() | FTP or file manager | High | 2 minutes |
| php -m | SSH | Very high | 30 seconds |
| extension_loaded() | FTP or file manager | Very high | 3 minutes |
| Select PHP Version section in cPanel | cPanel | Medium | 1 minute |
The php -m method is the most accurate because it directly queries the PHP engine. The phpinfo() method provides more information but is harder to read. The extension_loaded() method is accurate for testing a specific extension but isn't suitable for a complete list.
Commonly used extensions that are usually missing
Based on experience, these extensions have the most installation requests:
intl— for internationalization and date/number formatting. WordPress and WooCommerce need it.imagick— image processing with higher quality than GD. Essential for photo-centric websites.redis— object and session caching. WordPress becomes faster with Redis Object Cache.sodium— modern cryptography. Some security libraries require it.bcmath— arbitrary precision calculations. Needed for payment gateways and financial calculations.
If your script uses these extensions and throws errors, first check whether the extension is actually missing or if it's just a PHP version issue. The error Fatal error: Uncaught Error: Call to undefined function means the function doesn't exist at all. The error Deprecated: Function means the function exists but the PHP version is too new and you need to update your code.
Frequently asked questions
How do I find out which PHP extensions are active on my hosting?
Create an info.php file with the content <?php phpinfo(); ?> and open it in your browser. If you have SSH, the php -m command shows the complete list of active extensions.
The extension I need isn't on my hosting; how do I request it?
Submit a support ticket and write the exact extension name, PHP version, and the reason you need it. Common extensions are usually installed quickly; heavy extensions may take longer.
Why does my site throw an undefined function error after migrating to new hosting?
PHP extensions on the new hosting may differ from the old hosting. Website files and the database are transferred, but the PHP configuration is not. Use the methods above to check which extension is missing and request its installation.
Can I install a PHP extension myself on shared hosting?
Usually not on shared hosting, because it requires root access and modifying server configuration files. If your control panel has the Select PHP Version option, you can enable some extensions yourself. Otherwise, you need to request it from support or migrate to a dedicated server.