我尝试使用composer安装扩展程序:
composer require magenest/module-worldpay-and-subscriptions:2.0.0
得到这个:
[InvalidArgumentException]
Package magenest/module-worldpay-and-subscriptions at version 2.0.0 has a PHP requirement incompatible with your PHP version (5.4.45)
当我运行php -v
命令时,它返回:
PHP 5.4.45 (cli) (built: Nov 28 2017 10:34:31)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.0.4, Copyright (c) 2002-2017, by ionCube Ltd.
with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies
但是,我在我的服务器上安装了所有PHP版本,因此当我运行命令时,我通常会预先指定PHP版本,例如php-7.0 bin/magento
此外,使用fakechroot
时 - 它在域组本身的上下文中设置了PHP版本。例如,当我运行此命令时:/usr/bin/fakechroot /usr/sbin/chroot /microcloud/domains/vampm2 /bin/bash
然后php -v
我得到:
[http]$ /usr/bin/fakechroot /usr/sbin/chroot /microcloud/domains/vampm2 /bin/bash
bash-4.1$ php -v
PHP 7.0.26 (cli) (built: Dec 19 2017 17:26:19) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.0.4, Copyright (c) 2002-2017, by ionCube Ltd.
with Zend OPcache v7.0.26, Copyright (c) 1999-2017, by Zend Technologies
bash-4.1$ exit
有谁能告诉我如何在没有作曲家的情况下运行composer require
来读取默认的PHP 5.4?使用 Magento ver 2.1.8
如何在指定版本中运行编辑器,例如就像我对Magento php-7.0 bin/magento
做的那样?{/ p>
答案 0 :(得分:2)
有三种选择:
composer
,例如。通过php-7.0 $(which composer)
composer.json
等配置密钥向"platform": { "php": "7.0.12" }
添加不同的版本要求(有关详细信息,请参阅https://getcomposer.org/doc/06-config.md#platform)composer
运行--ignore-platform-reqs
以完全忽略平台要求。然后安装所需的任何内容,而不检查已安装的PHP版本或扩展