为何终端里的 PHP 版本为 7.2,Laravel new 的时候提示是 7.1?
我在终端当中使用 php -v
查看版本号显示 7.2。
PHP 7.2.14 (cli) (built: Feb 1 2019 12:25:00) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
重新安装了 composer 和 laravel/installer,使用 laravel new blog
命令创建新项目时提示 7.1?
Crafting application...
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- This package requires php ^7.2 but your PHP version (7.1.32) does not satisfy that requirement.
Problem 2
- Installation request for doctrine/lexer 1.2.0 -> satisfiable by doctrine/lexer[1.2.0].
- doctrine/lexer 1.2.0 requires php ^7.2 -> your PHP version (7.1.32) does not satisfy that requirement.
Problem 3
- Installation request for laravel/framework v6.9.0 -> satisfiable by laravel/framework[v6.9.0].
- laravel/framework v6.9.0 requires php ^7.2 -> your PHP version (7.1.32) does not satisfy that requirement.
你可以通过查看你的
laravel
脚本是怎么写的。你系统应该存在两个php
.laravel
应该是在头部定义了env
使用 到了另外一个php