How to constraint compatibility with PHP without explicitly constraint all the depending packages

前端 未结 1 1372
鱼传尺愫
鱼传尺愫 2021-01-28 04:49

I got this requirement in my composer.json:

\"php\": \">= 5.6\",
\"symfony/http-foundation\": \"^3.0\"

The problem with that co

相关标签:
1条回答
  • 2021-01-28 05:03

    If you want to make composer.lock compatible with PHP 5.6, you have at least two options to achieve that:

    1. Use PHP 5.6 for composer update - you should be able to install multiple versions of PHP on your OS and run Composer like this:

      /path/to/php6.5 /path/to/composer update
      
    2. Use platform settings in composer.json to force installation for specific version regardless PHP version used to run Composer commands:

      "config": {
          "platform": {
              "php": "5.6.38"
          }
      },
      
    0 讨论(0)
提交回复
热议问题