PHP.net will end support for PHP 7.2 on 30 November 2020. In preparation for this event, Acquia is ending support for PHP 7.2 on 1 October 2020. At that time, we will remove PHP 7.2 from the Acquia Cloud platform and convert all remaining environments at that time to PHP 7.3. This deadline will not be extended, as it is critical your application be upgraded to ensure its continued security.
PHP 7.3 is supported on Drupal 7.68 and Drupal 8.6.4; PHP 7.4 is supported on Drupal 7.71 and Drupal 8.8.3. Both PHP 7.3 and 7.4 are supported on Drupal 9. Some known common issues with upgrading Drupal applications from PHP 7.2 to PHP 7.3 are documented below. While this article is focused primarily on updating to PHP 7.3, we have included some information on updating to PHP 7.4 near the end of the article.
This documentation is not intended to be exhaustive, and developers should consult the PHP.net Change Log and Drupal.org for the most up-to-date information. The following documentation is intended to provide guidance as you work to update your custom code or any contributed modules which are not compatible with later versions of PHP:
Fully updating your application requires several steps:
- Update your local development environment
- Update Drupal core and contributed modules
- Rebuild dependencies
- Update Pipelines
- Update and Deploy to the Acquia Cloud Development environment
Update your local development environment
It’s important that all members of the development team, and anyone who is running the application in their own environment, update their local version of PHP. See your local development environment’s documentation for details.
Update Drupal core and contributed modules
Update Drupal core and contributed projects to the most recent stable release. Drupal core 7.68 was released with support for PHP 7.3. Drupal core 8.6.4 and above is fully compatible with PHP 7.3, and many contributed projects may have fixes for PHP 7.3 in their latest releases.
Known issues
There are potential issues if you are moving your website to PHP 7.3.
- Drupal 7 core: The primary PHP 7.3 support issue for Drupal 7 core was resolved in December of 2019 and released in 7.68. Two related issues highlight some of the known compatibility issues for contributed projects. This is not exhaustive.
- PHP 7.3 deprecations: The PHP 7.3 migration guide has a set of deprecations defined here. There are some deprecated functions, like a series of multibyte string functions, but no major extension deprecation.
- Tagged Issues for PHP 7.3: Many issues have been tagged as PHP 7.3 across Drupal 7, 8 and 9 in both core and contributed projects. It is recommended to audit these issues for relevance to your application. Install any relevant patches or upgrade projects to mitigate.
- Are there any disadvantages to moving from PHP 7.2 to PHP 7.4? PHP 7.4 is available on Acquia Cloud today. Upgrading two versions could require more significant testing and preparation compared to an upgrade to PHP 7.3. A migration guide exists from 7.3 to 7.4 to help inform specifics that may or may not apply to your Acquia Cloud application. Also note that there may be known issues with PHP 7.4 on Acquia Cloud.
Rebuild dependencies
Many Composer dependencies only work with specific versions of PHP. This is critical for Drupal 8 and 9 applications. You should update your dependencies in an environment that is running your target version of PHP using composer update.
It might also be a good idea to enforce a platform version of PHP that will be used to negotiate dependencies regardless of the host machine’s PHP version. This can help avoid problems that arise when running `composer update` on a host machine that has a different PHP version than a local environment or the remote Stage/Prod environments.
"config": {
"platform": {
"php": "7.3"
}
}
Update Pipelines
If you’re using the Acquia Cloud Pipelines feature, you should update that environment to match your target environment’s PHP version as well. To use PHP versions greater than 5.6, you must be using Pipelines version 1.1.0. Set the version at the top of your ```acquia-pipelines.yml``` file:
version: 1.1.0
Then set the PHP version under services:
services:
- mysql
- php:
version: 7.3
Update and Deploy to the Acquia Cloud Development environment
We advise upgrading your development environment first to detect any potential problems in your codebase. You should then use your staging environment to test any changes that might need to be carried over before upgrading your production environment.
Once you have an artifact generated by a passing Pipelines build or other CI tool, you can update the PHP version on a target Acquia Cloud environment and then push your CI artifact to it for testing:
- Set the PHP version for one of your Acquia Cloud environments by following the instructions found in Configuring PHP settings.
- Once the PHP version has been set, you can deploy your CI artifact by following Best practices for working with code on Acquia Cloud.