What PHP version does Moodle require: compatibility
Updated 5 days ago
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 correspond to the versions indicated, not to any later version of PHP. 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 PHP 7.0 at minimum
Moodle 3.7 requires PHP 7.1 at minimum
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 update in that branch. Prepare a backup and test the change before applying it to the live site.
Moodle 4.5, 5.0, 5.1, and 5.2 require 64-bit PHP. In addition to the PHP version, review the extensions and database requirements in your version's notes.
You can consult the official PHP compatibility documentation.
For an installation or upgrade to Moodle 5.2, review its official requirements.