如何为Composer分配/设置特定的php版本? [英] How to assign / set specific php version to composer?
问题描述
我在wamp上安装了多个版本的php.现在我正在运行PHP 7.0.15,如您在屏幕快照中所见,但是我使用的laravel仍使用5.5.12,并且我无法使用laravelcollective.
I have multiple versions of php installed on my wamp . now I am running PHP 7.0.15 as you can see in screenshot, but the laravel I am using is still taking 5.5.12 and I am unable t use laravelcollective .
操作系统:Windows 10专业版
OS : Windows 10 Pro
我该如何解决?
更新的信息
E:\work\www\my-project>php --version
PHP 5.4.45 (cli) (built: Sep 2 2015 23:48:00)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
所以,看来我的项目正在使用5.4.45命令行.可能需要更改吗?但一无所知.
so, it seems my project is using 5.4.45 command line. may be I need to change it ? but having no idea of it.
推荐答案
已解决,我通过更改%PATH%
环境变量对其进行了修复.我将所有php版本的路径添加到%PATH%
,根据我的要求,我可以将其从上到下进行排列,因为CLI将采用环境变量设置中从上到下的第一个.
SOLVED, I fixed it by changing the %PATH%
environment variable to fix it . I added path of all php versions I have to %PATH%
, as per my requirement I can arrange it from top to bottom, as CLI will take the first one it will get from Top to bottom in environment variable setting.
请检查此 更好地了解我的解决方案.
please check this to have a better idea about my solution.
这篇关于如何为Composer分配/设置特定的php版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!