PHP Development

A Comprehensive List of PHP Modules and Their Functions

By the Domain India teamPublished 9 min read
Knowledge base article
Contents (12 sections)

PHP extensions, also called modules, add features to the PHP language: talking to databases, resizing images, encrypting data, reading XML and much more. Applications such as WordPress, Laravel and most shopping carts list the extensions they need. This guide explains what the common extensions do, and how to check which ones are loaded on your own hosting account.

Key takeaways

Most PHP applications need the same core set: mysqli or pdo_mysql, curl, mbstring, openssl, xml, gd, zip, intl and fileinfo. To see what your account actually loads, run php -m over SSH, or upload a small test file that calls extension_loaded(). On shared hosting you can't install extensions yourself: if one is missing, ask support with the extension name and your PHP version.

1. Extensions, functions and libraries

An extension is compiled code loaded into PHP, such as gd or intl. Each one adds functions and classes, such as imagecreatefromjpeg() or NumberFormatter. A PHP library, such as one installed with Composer, is ordinary PHP code that runs on top of the extensions.

Two errors look similar but mean different things:

  • Call to undefined function imagecreatefromjpeg() means an extension is missing, here gd.
  • imagecreatefromjpeg() has been disabled for security reasons means the extension is loaded but the server has switched off that one function. See PHP disabled functions on shared hosting.

2. Core extensions that are always there

Some extensions are part of every PHP build and can't be switched off. You never need to ask for them.

ExtensionWhat it does
Core, standardThe language itself and basic functions such as strings, arrays and files
dateDates, times and time zones
pcreRegular expressions, the preg_* functions
jsonEncoding and decoding JSON; always built in since PHP 8.0
hashHashing with SHA-256 and other algorithms, and HMAC
ReflectionInspecting classes and functions at run time, used by frameworks
SPLStandard data structures, iterators and exceptions
randomSecure random numbers and the Randomizer class, since PHP 8.2

3. Databases

ExtensionWhat it doesTypical user
mysqlndThe native MySQL driver that mysqli and pdo_mysql useLoaded with them
mysqliMySQL and MariaDB access, with prepared statementsWordPress, older scripts
PDOOne interface for many databasesLaravel, most modern code
pdo_mysqlThe MySQL and MariaDB driver for PDOLaravel, Symfony
pdo_sqlite, sqlite3SQLite, a database stored in a single fileSmall apps, tests
pgsql, pdo_pgsqlPostgreSQLApps built for PostgreSQL
mongodbMongoDB, installed from PECLNoSQL applications

For connecting PHP to your hosting database, see how to connect to the MySQL database.

4. Text, web and data formats

ExtensionWhat it does
mbstringMultibyte string handling, needed for Hindi, Tamil and other non-Latin text in UTF-8
iconvConverting text between character encodings
intlLocale-aware formatting of numbers, dates and currency, plus sorting and transliteration
ctypeQuick checks such as "is this all digits"
filterValidating and cleaning input, such as email addresses and URLs
curlHTTP requests to APIs and payment gateways
opensslTLS connections, certificates and encryption
sodiumModern encryption and signatures (libsodium)
xml, dom, SimpleXMLReading and building XML and HTML documents
xmlreader, xmlwriterStreaming large XML files without loading them all into memory
xslXSLT transformations of XML
soapCalling or providing SOAP web services
gettextTranslating an application's text
tokenizerSplitting PHP code into tokens, used by frameworks and tools
sessionKeeping a user logged in across pages

5. Files, images and compression

ExtensionWhat it does
fileinfoDetecting a file's real type from its contents, important for safe uploads
gdCreating and resizing images, thumbnails and captchas
imagickAdvanced image processing with ImageMagick, and more formats than gd
exifReading camera metadata from JPEG and TIFF photos
zipCreating and opening ZIP archives, used by WordPress updates and plugin installs
zlibgzip compression
bz2bzip2 compression
PharRunning PHP archives such as composer.phar

6. Maths, caching and other extensions

ExtensionWhat it does
bcmathExact decimal maths of any size, useful for money and accounting
gmpVery large whole numbers, often used in cryptography
calendarConverting between calendar systems
OPcacheKeeps compiled PHP in memory so pages run faster
apcuAn in-memory store for application data on one server
redis, memcachedClients for Redis and Memcached cache servers
ldapLogging in against a company directory
ftpConnecting to FTP servers from PHP
socketsLow-level network connections
posix, pcntlUnix process information and process control, for command-line scripts
ionCube LoaderRuns commercial PHP scripts encoded with ionCube
xdebugStep debugging and profiling, for development machines only

A few names from older lists are gone. mysql was removed in PHP 7.0, so use mysqli or PDO. mcrypt and xmlrpc are no longer part of PHP and survive only as add-ons for old code. PHP 8.4 moved imap and pspell out of the core, so mailbox-reading scripts should be checked before an upgrade.

7. Check what is loaded on your account

A list of possible extensions is only half the answer. What matters is what your own site loads, for the PHP version it uses. phpinfo() is disabled on our cPanel servers, so use one of these methods instead.

Method 1: php -m over SSH

Jailed SSH access is available on every shared hosting plan (cPanel, DirectAdmin, Webuzo). It is off by default; ask support to enable it for your account, and see enabling and accessing jailed SSH. Once you are logged in, cd into your site's folder and run:

bash
php -v
php -m
php -m | grep -i intl

The command-line PHP can be a different version from your website, so compare php -v with the version set for your domain in the panel. If they differ, use Method 2.

Method 2: a test file

Create a file with a hard-to-guess name, such as ext-check-7q2.php, in your site's folder:

php
<?php
foreach (['mysqli', 'pdo_mysql', 'curl', 'mbstring', 'intl', 'gd', 'zip', 'sodium'] as $ext) {
    echo $ext . ': ' . (extension_loaded($ext) ? 'loaded' : 'missing') . "\n";
}
echo 'PHP ' . PHP_VERSION;

Open it in your browser, note the result, then delete the file. This shows exactly what your website sees. On cPanel, add ?t=1 to the address so you don't get a cached copy.

Method 3: WordPress Site Health

In WordPress, Tools › Site Health warns when a required or recommended extension is missing, and the Info › Server tab shows the PHP version and key settings.

Measured on our servers, 23 September 2026

On the default PHP 8.3 build, the common set (mysqli, pdo_mysql, curl, mbstring, intl, gd, zip, xml, openssl, fileinfo, exif, bcmath, soap) is loaded on both our cPanel and DirectAdmin servers. Imagick and PostgreSQL are loaded on cPanel but not DirectAdmin; ionCube Loader and sodium are loaded on DirectAdmin but not cPanel. Redis, Memcached, APCu, MongoDB and Xdebug are loaded on neither. Other PHP versions can differ, so always check your own account.

8. When an extension is missing

On shared hosting the server's PHP builds are shared by every account, so you can't install or compile an extension yourself, and a php.ini or .user.ini line can't load one. What you can do:

  1. Check your PHP version first.
    The extension may be available on another version. See how to change the PHP version.
  2. Use an alternative.
    WordPress falls back to gd when imagick is missing, and ships a pure-PHP fallback for sodium. Many libraries have similar fallbacks.
  3. Ask support.
    Open a ticket with the extension name, your domain and the PHP version. We will tell you whether it can be added for that version.

If your project needs extensions or a set-up that shared hosting can't offer, a VPS gives you root access to install exactly what you need. See how to enable essential PHP extensions on a VPS.

9. Where Domain India fits

Domain India cPanel and DirectAdmin shared hosting come with the extensions most PHP applications need already loaded, and a choice of PHP versions per account. For a full picture of what runs on the servers, see what software versions Domain India hosting runs and the hosting compatible technologies list.

cPanel Growth
₹200/mo + GST
  • 50 GB NVMe SSD Storage
  • 100 GB Monthly Bandwidth
  • 5 Websites
  • 50 Email Accounts
See plan details
VPS Starter
₹552.65/mo + GST
  • 1 vCPU
  • 2 GB DDR4 RAM
  • 64 GB NVMe SSD Storage
  • 2 TB Monthly Bandwidth
See plan details

Card prices are live list prices, excluding 18% GST.

What is a PHP extension?

A PHP extension is compiled code loaded into PHP that adds functions and classes, such as gd for images, curl for HTTP requests or pdo_mysql for databases. Applications list the extensions they need in their requirements.

How do I check which PHP extensions are enabled without phpinfo?

Run php -m over SSH from inside your site's folder, or upload a small PHP file that prints extension_loaded('name') for each extension you need, open it in your browser and then delete it. phpinfo() is disabled on Domain India cPanel servers.

What does "Call to undefined function" mean?

It usually means the extension that provides the function is not loaded for your PHP version. A message saying a function "has been disabled for security reasons" is different: the extension is loaded but the server has switched that function off.

Can I install a PHP extension on shared hosting?

No. Shared servers use PHP builds shared by every account, so extensions can't be installed or loaded per account. Try another PHP version, or open a ticket with the extension name and PHP version. On a VPS you can install any extension yourself.

Which PHP extensions does WordPress need?

WordPress needs a MySQL driver (mysqli) and works best with curl, mbstring, openssl, xml, zip, exif, fileinfo, intl and either imagick or gd. Tools › Site Health in the dashboard tells you if a recommended extension is missing.

Is the mysql extension still available?

No. The old mysql extension was removed in PHP 7.0. Code that uses mysql_connect() must be updated to mysqli or PDO.

Ready to check your account? Upload the test file from section 7, compare the result with your application's requirements, and open a support ticket with the extension name and PHP version if anything is missing, or compare VPS plans if you need full control.

Missing a PHP extension?

Tell us the extension name, your domain and the PHP version your site uses, and we will check what is available for your account.

Open a support ticket

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
PHP Extensions List: What Each Module Does | Domain India