PHP in AL2 - Amazon Linux 2
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

PHP in AL2

AL2 currently provides two fully supported versions of the PHP programming language as part of AL2 Extras Library. Each PHP version is supported for the same time frame as upstream PHP as listed under deprecated date in List of Amazon Linux 2 Extras.

For information about how to use AL2 Extras to install application and software updates on your instances, see AL2 Extras Library.

To assist migration to AL2023, both PHP 8.1 and 8.2 are available on AL2 and AL2023.

Note

AL2 includes PHP 7.1, 7.2, 7.3, and 7.4 in amazon-linux-extras. All of these Extras are EOL and are not guaranteed to get any additional security updates.

To find out when each version of PHP is deprecated in AL2, see the List of Amazon Linux 2 Extras.

Migrating from earlier PHP 8.x versions

The upstream PHP community put together comprehensive migration documentation for moving to PHP 8.2 from PHP 8.1. Documentation also exists for migrating from PHP 8.0 to 8.1.

AL2 includes PHP 8.0, 8.1, and 8.2 in amazon-linux-extras that enables an efficient upgrade path to AL2023. To find out when each version of PHP is deprecated in AL2, see the List of Amazon Linux 2 Extras.

Migrating from PHP 7.x versions

The upstream PHP community put together comprehensive migration documentation for moving to PHP 8.0 from PHP 7.4. Combined with the documentation referenced in the previous section on migrating to PHP 8.1, and PHP 8.2, you have all of the steps needed to migrate your PHP based application to modern PHP.

The PHP project maintains a list and schedule of supported versions, along with a list of unsupported branches.

Note

When AL2023 was released, all 7.x and 5.x versions of PHP were not supported by the PHP community, and were not included as options in AL2023.