composer 设置版本号,如何为Composer分配/设置特定的php版本?

用户在Windows 10 Pro上遇到了一个PHP版本问题,尽管WAMP正在运行PHP7.0.15,但其Laravel项目仍然使用的是5.5.12版本。在命令行中,项目似乎使用的是PHP5.4.45。为了解决这个问题,用户通过更新`%PATH%`环境变量,将所有PHP版本路径添加到其中,并根据需求调整顺序,使得CLI优先使用所需的PHP版本。通过这种方法,用户成功解决了问题。
摘要由CSDN通过智能技术生成

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 .

OS : Windows 10 Pro

How I can fix it ?

Qt6OI.jpg

Updated information

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

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.

解决方案

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值