How to always use ignore-platform-reqs flag when running composer?

It’s recommended to fake php version, rather than ignore platform requirements. Add

"platform":{"php":"5.5"}

to your ~/.composer/config.json or use composer config -g -e to edit it.

An example of sufficient config to fake php version:

{
    "config": {
        "platform":{
            "php":"5.5"
        }
    }
}

It may have much more options though.

UPDATE:
starting from v2.3.0 you can use environment variables.
Please see Yakatz’ answer

Leave a Comment