本文介绍了使用php 7运行composer,但安装php 5软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用安装在docker容器中的php 7运行composer,但最终的软件将在php 5上运行,因为多数民众赞成生产服务器正在运行。

I would like to run composer using php 7 installed inside a docker container, but the final software will run on php 5 since thats what the production server is running.

我没有看到为php 5安装软件和使用php 7 cli运行作曲者之间的任何关联,但似乎存在连接。

I don't see any correlation between installing software for php 5 and using php 7 cli to run composer, yet there appears to be a connection.

我怎么知道不管我运行哪个版本的composer,都无关紧要的是安装的软件包。

How can I tell composer that it doesn't matter what version I run composer with, what matters is the packages that it installs.

推荐答案

正确解决方案似乎是添加以下内容

The correct solution it seems is to add the following

"config": {
    "platform": {
        "php": "5.6.17"
    }
}

作曲家文件,那么它将用作您要尊重的php的版本。

to your composer file, then it will use that as the "version" of php you want to respect.

请参见。

这篇关于使用php 7运行composer,但安装php 5软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 05:53