Sometimes your local development version does not have the same PHP version of as your production server or perhaps you’re running composer outside your virtual machine (and your virtual machine has the correct PHP version but your host machine does not).
Since we want to build our dependencies based on the PHP version of our production server, we want composer to pretend we’re using the same PHP version as the production server.
We can do this by adding the following to our
composer update runs, it will install the dependencies as if you were running PHP
Shortcut to Modify composer.json
A quick way to add the above section to your
composer.json file is to run the following from the command-line:
composer config platform.php 7.1.4
Previously, this post talked about using
composer update --ignore-platform-reqs
to install your dependencies however this solution is much more likely to cause problems, since you may get some packages that require a higher PHP version (e.g.