Installing Laravel 4.2 via Laravel installer not possible on windows? - php

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??

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)

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%

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

This should do the work.
composer create-project laravel/laravel {{projectName}} 4.2.* --prefer-dist

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.

Related

I wanted to create a laravel project of version 8, and whenever i try to create one always the project of version 9 is created and i dont want it [duplicate]

The fastest and simplest way of installing Laravel is via composer command. From the laravel docs (http://laravel.com/docs/quick), it shows that we can install it with this:
composer create-project laravel/laravel your-project-name --prefer-dist
But, when you run the above command, it will grab the latest version of Laravel. How can I control it if I want to install latest version of 4.0.x? Or, 4.1.x when 4.2 is out?
From the composer help create-project command
The create-project command creates a new project from a given
package into a new directory. If executed without params and in a
directory with a composer.json file it installs the
packages for the current project.
You can use this command to bootstrap new projects or setup a clean
version-controlled installation for developers of your project.
[version]
You can also specify the version with the package name using = or : as
separator.
To install unstable packages, either specify the version you want, or
use the --stability=dev (where dev can be one of RC,
beta, alpha or dev).
This command works:
composer create-project laravel/laravel=4.1.27 your-project-name --prefer-dist
This works with the * notation.
Try via Composer Create-Project
You may also install Laravel by issuing the Composer create-project command in your terminal:
composer create-project laravel/laravel {directory} "5.0.*" --prefer-dist
Have a look:
Laravel 4.2 Documentation
Syntax (Via Composer):
composer create-project laravel/laravel {directory} 4.2 --prefer-dist
Example:
composer create-project laravel/laravel my_laravel_dir 4.2
Where 4.2 is your version of laravel.
Note: It will take the latest version of Laravel automatically If you will not provide any version.
composer create-project laravel/laravel=4.1.27 your-project-name --prefer-dist
And then you probably need to install all of vendor packages, so
composer install
If you want to use a stable version of your preferred Laravel version of choice, use:
composer create-project --prefer-dist laravel/laravel project-name "5.5.*"
That will pick out the most recent or best update of version 5.5.* (5.5.28)
To install specific version of laravel try this & simply command on terminal
composer create-project --prefer-dist laravel/laravel:5.5.0 {dir-name}
Installing specific laravel version with composer create-project
composer global require laravel/installer
Then, if you want install specific version then just edit version values "6." , "5.8."
composer create-project --prefer-dist laravel/laravel Projectname "6.*"
Run Local Development Server
php artisan serve

My laravel installer just hang when i try to install laravel through composer

My laravel installer just hang when i try to install laravel through composer.
I have installed the composer.Then i went to the command prompt and type the command
"composer create-project --prefer-dist laravel/laravel blog"
But it appeared and not doing anything further
Try clearing composer cache
composer clearcache
If still doesn't work
Try using laravel installer for it
https://laravel.com/docs/7.x/installation#installing-laravel

Can't install desired version of Laravel

I can't Install Laravel 6.0, when I run this command:
composer create-project laravel/laravel laravel_6.0
I want to install v6.0 but it comes with v5.8.17.
How can I download the latest version of laravel? My Php version is 7.2.10
You will need to make sure your server meets the following requirements:
PHP >= 7.2.0
BCMath PHP Extension
Ctype PHP Extension
JSON PHP Extension
Mbstring PHP Extension
OpenSSL PHP Extension
PDO PHP Extension
Tokenizer PHP Extension
XML PHP Extension
And than First, download the Laravel installer using Composer:
composer global require laravel/installer
Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify.
Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:
composer create-project --prefer-dist laravel/laravel blog
Or
composer create-project --prefer-dist laravel/laravel blog "6.0.*"
From today you can install laravel version 6 with this command:
composer create-project --prefer-dist laravel/laravel blog
I recently, updated all of my projects to laravel 6.0,
I'm using, Ubuntu 19.04
by following command it works for my system
composer create-project --prefer-dist laravel/laravel your-project-name
Here are some few ways to install laravel by specifying version
composer create-project laravel/laravel=6.0 your-project-name --prefer-dist
composer create-project --prefer-dist laravel/laravel:6.0 your-project-name
composer create-project --prefer-dist laravel/laravel your-project-name "6.*"
It's not loaded into Packagist as an official version yet. Therefore, you need to use the "dev-develop" version which contains the latest unstable commit from GitHub:
$ composer create-project laravel/laravel laravel_6.0 dev-develop
re setup the composer. Show php 7 version when installing.

Composer freezes while installing Laravel 5.6

I am installing Laravel 5.6 with the composer. This process is carried out in Windows 10's native command prompt. However when I type in composer create-project --prefer-dist laravel/laravel my_blog, composer doesn't do anything. It just stays still. Left it for 1.5 hours and the result is same.
Please help me fix it.
php composer create-project laravel/laravel my_blog --prefer-dist
File composer.phar must be in folder where you start command create-project OR add composer.phar to your PATH environment variable
For test (in terminal):
composer -V

Installing specific laravel version with composer create-project

The fastest and simplest way of installing Laravel is via composer command. From the laravel docs (http://laravel.com/docs/quick), it shows that we can install it with this:
composer create-project laravel/laravel your-project-name --prefer-dist
But, when you run the above command, it will grab the latest version of Laravel. How can I control it if I want to install latest version of 4.0.x? Or, 4.1.x when 4.2 is out?
From the composer help create-project command
The create-project command creates a new project from a given
package into a new directory. If executed without params and in a
directory with a composer.json file it installs the
packages for the current project.
You can use this command to bootstrap new projects or setup a clean
version-controlled installation for developers of your project.
[version]
You can also specify the version with the package name using = or : as
separator.
To install unstable packages, either specify the version you want, or
use the --stability=dev (where dev can be one of RC,
beta, alpha or dev).
This command works:
composer create-project laravel/laravel=4.1.27 your-project-name --prefer-dist
This works with the * notation.
Try via Composer Create-Project
You may also install Laravel by issuing the Composer create-project command in your terminal:
composer create-project laravel/laravel {directory} "5.0.*" --prefer-dist
Have a look:
Laravel 4.2 Documentation
Syntax (Via Composer):
composer create-project laravel/laravel {directory} 4.2 --prefer-dist
Example:
composer create-project laravel/laravel my_laravel_dir 4.2
Where 4.2 is your version of laravel.
Note: It will take the latest version of Laravel automatically If you will not provide any version.
composer create-project laravel/laravel=4.1.27 your-project-name --prefer-dist
And then you probably need to install all of vendor packages, so
composer install
If you want to use a stable version of your preferred Laravel version of choice, use:
composer create-project --prefer-dist laravel/laravel project-name "5.5.*"
That will pick out the most recent or best update of version 5.5.* (5.5.28)
To install specific version of laravel try this & simply command on terminal
composer create-project --prefer-dist laravel/laravel:5.5.0 {dir-name}
Installing specific laravel version with composer create-project
composer global require laravel/installer
Then, if you want install specific version then just edit version values "6." , "5.8."
composer create-project --prefer-dist laravel/laravel Projectname "6.*"
Run Local Development Server
php artisan serve

Categories