Reputation: 1061
While installing laravel on windows via laravel installer with command composer global require "laravel/installer=~1.1"
then laravel new project-name
, it now instal laravel 5.0, latest version. How to install laravel 4.2 version via laravel installer with laravel new
command??
Upvotes: 2
Views: 8218
Reputation: 148
It's better to use composer
composer create-project laravel/laravel {directory} 4.2 --prefer-dist
Just open your power shell and cd to the directory you want to run the project, and run the above command, make sure you have composer first.
Upvotes: 0
Reputation: 148
Download git bash
cd /opt/lampp/htdocs
and run
composer create-project laravel/laravel [name] 4.2.* --prefer-dist
where [name] is your projects name.
Upvotes: 0
Reputation: 105
This should do the work.
composer create-project laravel/laravel {{projectName}} 4.2.* --prefer-dist
Upvotes: 0
Reputation: 15
This should solve the problem. Happy Programming
Upvotes: 0
Reputation: 790
This works for me on top of homestead:
$ composer create-project laravel/laravel YOURFOLDERNAME 4.2.*
Note the * for the version #.
Outputs:
Installing laravel/laravel (v4.2.11)
- Installing laravel/laravel (v4.2.11)
Downloading: 100%
Upvotes: 2
Reputation: 152860
No that's not possible with the laravel installer. It will always get the latest release. Here's the source of the laravel new
command
protected function download($zipFile)
{
$response = \GuzzleHttp\get('http://cabinet.laravel.com/latest.zip')->getBody();
// ^^^^^^^^^^
file_put_contents($zipFile, $response);
return $this;
}
What you can do is use composer create-project
and specify the version:
composer create-project laravel/laravel project-name ~4.2.0 --prefer-dist
By the way ~4.2.0
means that you will get the latest version with 4.2.*
(currently that's 4.2.11)
Upvotes: 10
Reputation: 1349
If you don't plan to create multiple 4.2 projects, you can install single one by issuing another Composer command:
composer create-project laravel/laravel foldername "4.2" --prefer-dist
where foldername is a name of folder for your project and "4.2" specifies version to install.
I tried it on my Windows 7 machine just now, it works.
P.S. Laravel documentation shows slightly different syntax:
composer create-project laravel/laravel "4.2" --prefer-dist
but this creates 5.0 installation in folder named "4.2".
Upvotes: 1