List of required and recomended php extension for Drupal 11, 10, 9, 8 site

Drupal, like all versions (11, 10, 9, 8) relies on PHP to power its core functionality, making certain PHP extensions critical for optimal performance and compatibility. These extensions enable essential features such as database integration, image processing, and secure encryption, ensuring your site runs smoothly. 
In this article, we'll explore the key PHP extensions required for Drupal and how they contribute to its functionality.
Important to know that installed PHP extensions can vary between different server or hosting providers, it's good to have a nice list of required and recommended PHP extensions. 
 

Drupal php requirements
Drupal PHP Status information

To check current PHP version status and other technical data, you can check Status report page (URL: /admin/reports/status )
And details information about PHP (URL: /admin/reports/status/php )

 

PHP extensions required for Drupal

In this list are listed core PHP extensions, for versions of Drupal 10, 9, 8
Operation system: Ubuntu;
Web Server: Apache2;
 

libapache2-mod-php8.1
libphp8.1-embed
php8.1-apcu
php8.1-bcmath
php8.1-bz2
php8.1-cli
php8.1-common
php8.1-curl
php8.1-fpm
php8.1-gd
php8.1-igbinary
php8.1-mbstring
php8.1-mcrypt
php8.1-memcached
php8.1-msgpack
php8.1-mysql
php8.1-opcache
php8.1-readline
php8.1-uuid
php8.1-xml
php8.1-xsl
php8.1-yaml
php8.1-zip
php8.1
 

If in Drupal setup MongoDB database is used:
php8.1-mongodb
 

Intall recomended PHP Extentions (Drupal 10, 9, 8)
apt-get install libapache2-mod-php8.1 libphp8.1-embed php8.1-apcu php8.1-bcmath php8.1-bz2 php8.1-cli php8.1-common php8.1-curl php8.1-fpm php8.1-gd php8.1-igbinary php8.1-mbstring php8.1-mcrypt php8.1-memcached php8.1-msgpack php8.1-mysql php8.1-opcache php8.1-readline php8.1-uuid php8.1-xml php8.1-xsl php8.1-yaml php8.1-zip php8.1

Command line to install recommended PHP extensions for Drupal 10, 9, 8 (assumed that Apache2 is used as a web server, Operation system is Ubuntu like (~22.04))

(Optional) Intall MongoDB support
apt-get install php8.1-mongodb

Optional, install MongoDB database PHP extension 

 

PHP extensions required for Drupal 11

In this list are listed core PHP extensions, for versions of Drupal 11
Operation system: Ubuntu;
Web Server: Apache2;
 

libapache2-mod-php8.3
libphp8.3-embed
php8.3-apcu
php8.3-bcmath
php8.3-bz2
php8.3-cli
php8.3-common
php8.3-curl
php8.3-fpm
php8.3-gd
php8.3-igbinary
php8.3-mbstring
php8.3-mcrypt
php8.3-memcached
php8.3-msgpack
php8.3-mysql
php8.3-opcache
php8.3-readline
php8.3-uuid
php8.3-xml
php8.3-xsl
php8.3-yaml
php8.3-zip
php8.3
 

If in Drupal setup MongoDB database is used:
php8.3-mongodb
 

Intall recomended PHP Extentions (Drupal 11)
apt-get install libapache2-mod-php8.3 libphp8.3-embed php8.3-apcu php8.3-bcmath php8.3-bz2 php8.3-cli php8.3-common php8.3-curl php8.3-fpm php8.3-gd php8.3-igbinary php8.3-mbstring php8.3-mcrypt php8.3-memcached php8.3-msgpack php8.3-mysql php8.3-opcache php8.3-readline php8.3-uuid php8.3-xml php8.3-xsl php8.3-yaml php8.3-zip php8.3

Command line to install recommended PHP extensions for Drupal 11 (assumed that Apache2 is used as a web server, Operation system is Ubuntu like (~22.04))