在安装Laravel时获取旧的php版本 [英] Getting old php version while installing Laravel

查看:48
本文介绍了在安装Laravel时获取旧的php版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在不同的驱动器(Windows)中安装了两个xampp,如下所示:

I've installed two xampp in different drives(windows) as follow:

Drive G: xampp (php 5.6)
Drive C: xampp (php 7.2)

我还在PATH变量中将环境变量设置为php 7驱动器.但是在安装最新的laravel期间仍然出现错误:

I've also set environmental variable to php 7 drive in PATH variable. But still getting error during installing latest laravel that:

This package requires php >=7.0.0 but your PHP version (5.6.35) does not satisfy that requirement.

当我在CMD中运行以下命令时,它也会显示php 5.6.3:

When I run following command in CMD it also shows php 5.6.3:

php -v

系统重新启动,CMD重新启动,还有什么我想念或不得不做的事情才能使我获得最新的PHP版本?奇怪的是,当我在xampp中使用7版本运行php文件时,它在phpinfo()中显示PHP 7.2.4.

System is restarted, CMD is restared, what else I missed or have to do so that I can get latest PHP version? The strange thing is that when I run php file in xampp with 7 version it shows PHP 7.2.4 in phpinfo().

注意:对于其他旧项目,我确实需要php 5.6,这就是为什么我无法删除第二个xampp的原因.

Note: I do need php 5.6 for other old projects that's why I can't delete second xampp.

推荐答案

我不确定您使用的是哪个窗口,但我认为这是第10个窗口

I am not sure which windows you are using but as i think it is window 10

请确保在您的案例中,将 C:\ xampp \ php 的PATH添加到系统变量而不是用户变量中

Make Sure you are adding PATH in your case C:\xampp\php in system variables instead of user variables

并尝试在cmd中运行 ECHO%PATH%,并检查是否为PHP 7而非5.6添加了路径

and try to run ECHO %PATH% in cmd and check if there is path added for PHP 7 not 5.6

这篇关于在安装Laravel时获取旧的php版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆