The PHP version requires 5.5.9+

2. Install the composer

3. Download laravel

Open CMD, go to the directory you want to download, and run the following Composer command:

composer create-project laravel/laravel --prefer-dist
Copy the code

The procedure may report the following error:

Failed to enable crypto
  failed to open stream: operation failed
Copy the code

Need to change the composer mirroring source:

Change to Ali mirror:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
Copy the code

Replace with Laravel China mirror:

 composer config -g repo.packagist composer https://packagist.laravel-china.org
Copy the code

Replace with China full mirror:

composer config -g repo.packagist composer https://packagist.phpcomposer.com
Copy the code

If you want to specify a custom installation directory name, such as Laravelapp, use the following command:

composer create-project laravel/laravel laravelapp --prefer-dist
Copy the code

If an error occurs during installation:

[RuntimeException]
Could not load package classpreloader/classpreloader in http://packagist.org: [UnexpectedValueException] Could not parse version constraint ^1.2.2: Invalid version string "^1.2.2"
Copy the code

To update Composer:

composer self-update
Copy the code