On occasion Altis will make a PHP version update available. Once a particular version of PHP is out of support, updating to a later version will become mandatory to help protect the security of your application.
There are 2 key steps to getting ready for a new version of PHP:
- Checking your application is compatible with the new version and making any necessary updates
- Requesting the PHP upgrade for your cloud environments
Note: Before carrying out the following tasks locally, ensure your application is fully installed so that all code that will be deployed to the cloud is present.
composer.json you may have some code like the following:
If present, and the PHP version does not match the version you are upgrading to you should update it to reflect the new target PHP version.
In addition you must add the following setting in the
config property of your
This will prevent Composer from exiting your application early while your cloud environment is being updated.
The first task is to ensure your application has the latest patch versions of all Altis modules by running the following command in your project root:
composer update "altis/*" --with-all-dependencies
Afterwards commit the updated
The next step is using the PHP Compatibility package for PHP Code Sniffer. The guide belows shows you how to install and use this tool globally, however you may wish to install them directly in your project and use them in CI as part of your code linting process.
First install the standard and dependencies using the following command:
composer global require dealerdirect/phpcodesniffer-composer-installer phpcompatibility/php-compatibility
Next run the standard against your codebase for the target PHP version, in this example PHP 7.4:
phpcs -p --standard=PHPCompatibility \
--runtime-set testVersion 7.4 \
-d memory_limit=1G \
Note: You must fix anything reported as an "Error". Warnings can be ignored at your discretion.
Fix any reported errors (ignoring those listed in the section below) by upgrading affected third party plugins and amending first party custom code as needed following your standard code review and deployment processes.
There are some known warnings in the following packages that you can safely ignore. Altis guarantees its core packages and their dependencies are verified as working with the versions outlined in the compatibility chart at the top of this page.
You can add these to the ignored directories in the command when checking if desired; e.g.
Once you are confident that your application is compatible with the version of PHP to upgrade to you should do the following:
- Deploy the updated application to the environment you wish to update, we recommend starting with your non production environments first
- Create a support ticket for the target environment with the type "Task", titled "Upgrade to PHP 7.4", replacing "7.4" with the target version if necessary
Note: If you are upgrading to an Altis version that is not compatible with the environment's current PHP version you will need to request that the environment is updated prior to deploying the upgrade.
See the Getting Help With Altis guide for more information on creating support tickets.
The Altis team will follow up with you on the ticket once the environment has been updated.
Once your environment has been upgraded, the PHP upgrade will take effect upon the next application deployment.