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??
7 Answers
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)
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".
- Delete XAMMP and/or Homestead
- Install Laragon (http://laragon.org/)
This should solve the problem. Happy Programming
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.
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.