Force composer to use specific PHP version

Force composer to use specific PHP version

Sometimes you have a different version of PHP installed on your machine or setup as on the live server. To prevent the installation of packages which won't be compatible on the live server, you can define the PHP version used for composer to collect the packages.

To do so set the following flag in your config in the composer.json:

"config": {
    "platform": {
        "php": "7.2.11"
    }
},