Hi, I’m proud to announce that starting today, testing and deploying your applications on various PHP versions has never been that easy!
Switching from a PHP version to another is a matter of a single line change in your application configuration file.
Platform.sh supports the following PHP versions:
Also, you can choose to enable and disable any PHP extensions that you want to use or not.
How to do?
Let’s say you want to test your application with a different PHP version.
Start by branching your environment to get a fresh new environment. Call this environment
If you are using the CLI, simply type:
$ platform environment:branch php-5-6
.platform.app.yaml file, simply change the type to:
Commit and push this change:
$ git add .platform.app.yaml $ git commit -m "Upgrade to PHP 5.6" $ git push
That’s it! Your new environment is now built with PHP 5.6.
You can confirm by SSH in the environment and type
php -v :
web@tfq54akunfoby-php-5-6--php:~$ php -v PHP 5.6.12-1~dotdeb+7.1 (cli) (built: Aug 8 2015 01:28:25)
Deploy the changes
Once you are sure everything works as expected, you can merge this change to deploy the parent environment with the new version.
With the CLI, it’s simply:
$ platform environment:merge
Read more about configuring PHP version and extensions on our public documentation.