Technology hardware and software are upgrading constantly, mostly in order to provide a better service and/or improve security, in the middle of this constant changing the PHP scripting language needs to cope with all these dynamic environments.
Magento Cloud also facilitates changing the PHP version; providing more convenience to any DevOps team.
When upgrading the PHP version, its version needs to be compatible with the Magento host version. The following table can be referenced for helping to determine the correct PHP version.
|Adobe Commerce version||PHP version|
For changing the PHP version, the file .magento.app.yaml must be edited. For example:
Original service definition:
Updated service definition:
Commit the changes and push the changes for activating a redeploy:
git add –all
git commit -m “Changed PHP version”
git push <remote> <branch>
After redeploying open a tunnel via Magento CLI:
And check the service version for confirming the upgrade by SSH into the environment and check the PHP version:
After confirmation, the environment can be used as normal.