Composer uses wrong php version, but php -v shows the correct one (Ubuntu)(Composer 使用错误的 php 版本,但 php -v 显示正确的版本(Ubuntu))
问题描述
我正在尝试安装我的作曲家包,但它给了我这个:
I'm trying to install my composer packages, but it gives me this:
这个包需要 php >=7.0.0 但你的 PHP 版本 (5.5.9)
但是 php -v
给了我这个:PHP 7.0.22-0ubuntu0.16.04.1 (cli) ( NTS )
我正在运行 Ubuntu 16.04.3 LTS 机器,我找到了一些适用于 Mac 和 Windows 的灵魂,但似乎没有人在 Linux 上遇到问题?
I am running an Ubuntu 16.04.3 LTS machine, I found some soultions for Mac and Windows, but nobody seems to have the issue on Linux?
推荐答案
试试这个:
或者 composer.json 中的这个
or this in composer.json
在第二个解决方案中,基本上你是在伪造一个平台,然后运行 composer.phar update
in the second solution basically you're faking a platform, and run composer.phar update
after this
这篇关于Composer 使用错误的 php 版本,但 php -v 显示正确的版本(Ubuntu)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!