Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll
15/04/2025, by Ivan

Some individual modules may have special requirements for PHP extensions and configurations beyond those listed below, so please refer to the module documentation.

Supported PHP Versions

PHP Version Supported by Drupal Recommended for Drupal
5.5 No (see note 2 below) No
5.6 No (see note 2 below) No
7.0 Yes, 7.0.8 with Drupal 8.7.0 (see note 2 below) No
7.1 Yes No
7.2 Yes, with Drupal 8.5.0 Yes
7.3 Yes, with Drupal 8.6.4 (see note 1 below) Yes
7.4 Yes, with Drupal 8.8.3 Yes
8.0 No; see issue 3109885

1) Read the change notice for more information on PHP 7.3 support.
2) Read the change notice for details about ending support for PHP 5.

What Does “Recommended” PHP Version Mean?

Drupal will run on all supported PHP versions. The recommended PHP versions are the best choice for building a Drupal site because they will be supported longer. PHP 7 also brings significant performance and caching improvements.

PHP 5.5, 5.6, and 7.0 reached end-of-life in late 2018, and PHP 7.1 on December 1, 2019. (See PHP’s supported versions for more info.) Drupal 8 dropped support for PHP 5.5 and 5.6 in May 2019, and new versions require 7.0.8 or newer. We recommend upgrading to at least PHP 7.2. (Ubuntu 18.04 ships with PHP 7.2, and Debian stable uses 7.3.)

Note: This does not affect Drupal 7, which remains compatible with PHP 5.2.4 and higher. A separate announcement will be made if/when that changes — see Drupal 7 PHP Requirements.

Required PHP Extensions

Extensions used by Drupal Core are defined in the Core composer.json file — see for example the file for Drupal 8.7.x. Look under the “require” section for keys starting with “ext-”.

Note: Installing a PHP extension on your system (at least in Linux and Mac) means finding and installing the appropriate PHP package via the package manager. Usually, the package name for extension Foo is “php-foo” or “php7-foo,” but this can vary. Some extensions are included by default in the core PHP package.

Database Extensions

The PHP Data Objects (PDO) extension must be enabled for Drupal 8 to install and function correctly. The PECL version of PDO is incompatible with Drupal 8. Also, the PHP extension for your selected database must be installed and enabled.

Currently supported database connectors for Drupal include: mysql (original MySQL extension), mysqli (improved connector for modern MySQL), and pgsql (for PostgreSQL). Note: PHP 5.x no longer includes the mysql extension by default. See the links above for installation and enabling your chosen connector.

XML Extension

PHP XML extension (for Blog APIs, Drupal modules, and Ping). This extension is included by default in standard PHP installations; the Windows PHP version also supports it. Enabling the XML extension also includes PHP DOM, now a system requirement.

Image Processing Library

An image library for PHP, such as GD, is required in Drupal 8 for manipulating images (resizing, caching, and image modules). ImageMagick is also supported for basic image handling but has less contrib module support.

OpenSSL

PHP OpenSSL is recommended to allow Drupal to make outgoing HTTPS requests. Some platforms offer this as a separate package (e.g., php7-openssl).

Update Manager in Drupal may also check updates via HTTPS, making this extension even more important. See issue #1538118 and https://groups.drupal.org/node/506128.

JSON

Drupal 8 requires PHP compiled with JSON. JSON support is typically built into PHP core, but if you encounter errors like:

PHP Fatal error: Call to undefined function Drupal\\Component\\Serialization\\json_encode() in ... core/lib/Drupal/Component/Serialization/Json.php

try adding the JSON extension.

cURL

PHP cURL is required for the SimpleTest module in Drupal 8, and also used by Aggregator and other contrib modules. It is usually enabled by default in most Linux distributions. If not, enable it in php.ini (on Windows) or via package manager (on Linux).

Mbstring

PHP mbstring provides multi-byte string support, needed for non-English language installs and multilingual sites. It helps handle Unicode-based encodings like UTF-8 and UCS-2.

PHP Configuration Settings

Memory Requirements

PHP memory requirements vary greatly by enabled modules. The minimum is 64MB.

Warning messages will appear if your PHP config does not meet this. Though 64MB may be enough for a default Drupal install, live sites often need 128MB or 256MB. Some sites (especially with multimedia) may require more. Ensure your hosting provider supports enough memory for your current and future module sets. See Changing PHP memory limits for more details.

.htaccess Settings

Some memory settings are included in the default .htaccess file provided with Drupal, so you may not need to set them explicitly. These only work if:

  • You are using Apache (or compatible server)
  • The .htaccess file is read (AllowOverride All must be set in httpd.conf)
  • PHP is installed as an Apache module

Some shared hosting environments may restrict these settings. Ask your provider for help if needed.

Other Interfaces

See the PHP Manual on how to change settings for other interfaces.

Xdebug

If using Xdebug:

  • Set xdebug.show_exception_trace = 0 — to prevent the Drupal installer from crashing.
  • Set xdebug.collect_params = ? — a high value may prevent Drupal from installing/working.
  • Set xdebug.max_nesting_level = 256 — older defaults (100) can cause failures on some pages.

PHP from Other Sources

Drupal is designed to work with PHP from PHP.net. Every effort is made to support PHP from other sources, but it is not guaranteed. Suhosin is known to break some functions. Some OSes also package components differently.

PHP Requirements Details

See phpinfo() on Drupal.org to learn how to use phpinfo for system insights, including installed versions, environment variables, and more.

Newer PHP versions may be available through your Linux distribution. Check your distro’s documentation.

Notable Reminders

  • Be aware of the 32-bit PHP limitations.
  • Drupal Composer dependencies are built using PHP 5.5.9. Higher PHP versions may benefit from updated packages — use Composer update for optimal versions.
  • The Drupal 8 Update Manager can install/update modules and themes over SSH if required libraries (e.g., libssh2-php) are installed.
  • Using APC for opcode caching requires version 3.1.13 or higher with Drupal 8.
  • If opcache is enabled, the setting opcache.save_comments must be ON (1), or annotations will not load correctly.
Source URL:

Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.