简体   繁体   English

使用 Composer 将 Laravel 4 更新到更新版本

[英]Update Laravel 4 to newer version by using composer

I'm using Laravel 4, and for example, there is a new version.我正在使用 Laravel 4,例如,有一个新版本。 Let say, Laravel 4.2.比方说,Laravel 4.2。 Can I update Laravel 4 by setting composer.json and using composer command ?我可以通过设置composer.json并使用composer 命令来更新 Laravel 4 吗? I don't want to configure its files manually when there is a newer version.当有更新版本时,我不想手动配置其文件。

composer.json:作曲家.json:

"require": {
        "laravel/framework": "4.2.*@dev"
    },

in cmd:在 cmd 中:

composer update

Is it the correct way?这是正确的方法吗?

这是正确的,尽管您还需要查看官方文档并遵循官方升级指南,因为仍有一些文件可能需要根据您升级的版本手动更改。

For updating Laravel 6.x (Which means any subversions to V6) 用于更新Laravel 6.x(这意味着对V6的任何颠覆)
Just run this command 只需运行此命令

cd [laravel installation directory]
composer update

You must have composer installed on your VM or PC. 您必须在VM或PC上安装composer。

For Linux users only: 仅适用于Linux用户:

Composer directory must be owned by current user 作曲家目录必须归当前用户所有

//Check ownership
ls -la ~/ | grep ".composer"

//If you don't own the directory
chown -R [user]/[user] ~/.composer

Message me on any social media @smitpatelx Or leave a comment if you need any help or if your usecase differ from the above. 在任何社交媒体上发邮件给我@smitpatelx,或者如果您需要任何帮助或者您的用例与上述情况不同,请发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM