Which PHP Version Does Moodle Need? Compatibility
Updated last month
The PHP version you need depends on your Moodle version. Moodle 5.2 requires PHP 8.3 or 8.4; Moodle 5.0 and 5.1 support PHP 8.2, 8.3, and 8.4.
PHP compatibility with Moodle 4.5 to 5.2
Moodle version | Compatible PHP versions |
|---|---|
Moodle 5.2 | PHP 8.3 and 8.4 |
Moodle 5.1 | PHP 8.2, 8.3, and 8.4 |
Moodle 5.0 | PHP 8.2, 8.3, and 8.4 |
Moodle 4.5 LTS | PHP 8.1, 8.2, and 8.3 |
These ranges apply to the versions listed, not to any later PHP version. PHP 8.5 is not included in Moodle 4.5 to 5.2 compatibility.
Reference for earlier versions
Historical compatibility does not mean that a version is still receiving updates. For older installations, also check the requirements for the exact maintenance version you are using.
Moodle 3.4 and Moodle 3.5 support PHP 7.0 to 7.2
Moodle 3.6 requires at least PHP 7.0
Moodle 3.7 requires at least PHP 7.1
Moodle 3.9 supports PHP 7.2 to 7.4
Moodle 3.11 and 4.0 support PHP 7.3 to 8.0
Moodle 4.1 (LTS) supports PHP 7.4 to 8.1
Moodle 4.2 supports PHP 8.0 to 8.2
Moodle 4.3 supports PHP 8.0 to 8.2
Moodle 4.4 supports PHP 8.1 to 8.3
Before changing the PHP version
We recommend choosing the newest PHP version compatible with your Moodle installation and its plugins, and using the latest maintenance release in that branch. Prepare a backup and test the change before applying it to your live site.
Moodle 4.5, 5.0, 5.1, and 5.2 require 64-bit PHP. In addition to the PHP version, check the extensions and database requirements in the notes for your version.
You can consult the official PHP compatibility documentation.
To install or upgrade to Moodle 5.2, check its official requirements.