Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel installer keeps installing 5.5 instead of 5.6

I installed php 7.2.2 / apache 2.4 and mysql-5.7 on windows 10.

I want to install laravel 5.6

first:

1.  composer clear-cache
2.  composer update
3.  composer global require "laravel/installer"

php -v:

PHP 7.2.2 (cli) (built: Jan 31 2018 19:31:17) ( ZTS MSVC15 (Visual C++ 2017) x64 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

and Laravel Installer 2.0.1

I try this (according to the laravel doc 5.6):

composer create-project --prefer-dist laravel/laravel blog

But it install laravel 5.5.28

Why does composer keep installing laravel 5.5?

like image 837
ali ali Avatar asked Feb 04 '18 19:02

ali ali


People also ask

What is prefer Dist Laravel installation?

--prefer-dist would try to download and unzip archives of the dependencies using GitHub or another API when available. This is used for faster downloading of dependencies in most cases. It doesn't download the whole VCS history of the dependencies and it should be better cached.

Can I install Laravel without composer?

You do not need to run Composer on your server as well as locally, once you run composer install or composer update your project will have all its dependencies available and you can just upload it straight to your server.


2 Answers

Laravel 5.6 was not officially released until today (2018-02-07).

Now that it has been officially released, the Laravel installer and the composer create-project will use 5.6, instead of 5.5.

If you'd like to install a version that is not the current version, you need to specify the version to install as the last parameter to composer create-project.

For example, now that 5.6 has been released and is the current version, if you wanted to create a 5.5 project, you would add "5.5" to the composer statement:

composer create-project --prefer-dist laravel/laravel blog "5.5.*"

like image 68
patricus Avatar answered Sep 28 '22 11:09

patricus


I had same problem.

1- Your server php version must be ^7.1.3

2- You must Reinstall composer and select php ^7.1.3 in installation steps. then use command below to install version 5.6 of Laravel

 composer create-project laravel/laravel="5.6.*" Your-Project-Name

Or use command below to install latest version of Laravel

composer create-project laravel/laravel Your-Project-Name --prefer-dist
like image 43
Adnan Khatami Avatar answered Sep 28 '22 09:09

Adnan Khatami