Skip to main content
Last Reviewed: 2022-12-13

Upgrade PHP Versions

Learn how to upgrade PHP versions to resolve compatibility issues.


This section provides information on how to upgrade to a supported version of PHP.

Upgrading your site's PHP version will improve the security, performance, and supportability of your site. Refer to our blog post for an example of 62% performance gains after upgrading PHP.

Before You Begin

Older software is more likely to contain code that is incompatible with recent PHP versions. Before you upgrade your PHP version:

Information:
Note

Changes to pantheon.yml deployed as hotfixes are not detected.

Verify Your Current PHP Version

Go to the Site Dashboard and click Settings, and then click PHP version to verify your PHP version.

Information:
Note

Changes made to the pantheon.yml file on a branch are not detected when creating the Multidev environment for that branch. Refer to Why can’t I update the PHP version on my Multidev? for more information.

CMS Version Requirements

Confirm that your CMS is compatible before changing your PHP version.

Configure Your PHP Version

PHP versions can be set using the pantheon.yml configuration file in the root of your site's code repository.

Configurations made in pantheon.yml will override custom settings in pantheon.upstream.yml.

You can use SFTP or Git mode to create or change the pantheon.yml file. Follow the steps below to create or change your pantheon.yml file.

Multidev PHP Configuration

PHP version changes (and other configuration changes) are automatically detected when you modify the pantheon.yml file of a site with a pre-existing Multidev. A PHP version change will not appear in a Multidev created after your pantheon.yml changes are made.

Change the PHP Version on an Existing Multidev

Follow the steps to Configure Your PHP Version. Your Multidev configuration will automatically detect and apply the PHP version change from the pantheon.yml file.

Change the PHP Version on a New Multidev

You must make an additional modification to your pantheon.yml file to initiate the PHP version update in your Multidev if you created a new branch and added a Multidev after configuring your PHP version in the pantheon.yml file.

  1. Navigate to your pantheon.yml file.

  2. Modify your pantheon.yml file and re-commit to the Multidev.

  • It does not matter what change you make to the file. Any change- even a comment- will allow the Multidev to detect the configuration change. You will receive a notice indicating configuration changes have been detected and applied to the Multidev environment:

Troubleshoot Post-Upgrade Errors

Resolve PHP Version Compatibility Issues

We recommend working with theme, module, or plugin maintainers to resolve any issues upstream. For custom code, refer to the corresponding Backward Incompatible Changes documentation in the PHP Manual for migrating from one PHP version to another.

Upgrading PHP Version May Require Upgrading Drush Versions

Upgrade your current version of Drush if you see errors on the Pantheon Dashboard when trying to auto-run update.php. Refer to Manage Drush Versions on Pantheon for more information.

More Resources