[英]Installing Laravel with Composer create-project - how to use the newest version?
It has been a while since I created a new project with Laravel framework.自从我使用 Laravel 框架创建新项目以来已经有一段时间了。 Decided to install a fresh project so opened up V7 documentation at Install Via Composer Create-Project .
决定安装一个新项目,因此在Install Via Composer Create-Project打开了 V7 文档。
First updated my global Composer installation to the newest version: composer self-update
首先将我的全局 Composer 安装更新到最新版本:
composer self-update
Then ran installation with composer create-project as exampled in the docs: composer create-project --prefer-dist laravel/laravel myproject
然后按照文档中的示例使用composer create-project运行安装:
composer create-project --prefer-dist laravel/laravel myproject
After installation went into the directory to check Laravel's version: cd myproject && php laravel -V
安装后进入目录查看 Laravel 的版本:
cd myproject && php laravel -V
Much to my surprise it had installed a much older version: Laravel Framework 5.8.37
令我惊讶的是,它安装了一个更旧的版本:
Laravel Framework 5.8.37
Expected to get the newest version... Why did it install an older version, and how do I upgrade or instruct the create-project command to use the newest version?期望获得最新版本...为什么安装旧版本,如何升级或指示 create-project 命令使用最新版本?
It looks lile your environment is insufficient for L7 (like too old PHP version, missing required extensions etc).看起来你的环境对于 L7 来说是不够的(比如太旧的 PHP 版本,缺少所需的扩展等)。 You should ensure your environment fulfills Laravel requirements:
您应确保您的环境满足 Laravel 要求:
https://laravel.com/docs/7.x/installation#server-requirements https://laravel.com/docs/7.x/installation#server-requirements
Also keep in mind that php-cli version you use may be different from what your httpd is using (ie due to $PATH
and multiple PHP versions are installed).还要记住,您使用的 php-cli 版本可能与您的 httpd 使用的不同(即由于
$PATH
和安装了多个 PHP 版本)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.