There are multiple ways to install Laravel. The following is how to install laravel through composer. Composer is a dependency management tool for PHP. It allows you to declare code libraries that your project depends on and it will install them for you in your project. For composer downloads and related usage instructions, please see: https://getcomposer.org/
Composer Windows installation package https://getcomposer.org/Composer-Setup.exe. After downloading, just follow the installation wizard prompts and click Next. The installation process is very simple. The installation package will automatically set environment variables. You can use the composer command in any directory.
The installer will download composer for you and set up your PATH environment variable so you can simply call
composer
from any directory.
After installing composer, you can start installing laravel. Laravel requires the system PHP version to be 5.3.7 or above, and the MCrypt PHP extension is enabled.
Install laravel through Composer’s create-project command
Open CMD, CD to the directory where you want to install Laravel, and then run the following command. The installation process may take five or six minutes, depending on your internet speed.
composer create-project laravel/laravel --prefer-dist
This requires downloading the laravel package from GIThub in advance. There is a composer.json file in this package. Open CMD, CD to the decompression directory of laravel, and run the following command. Composer can detect and download related dependencies. After the installation is complete, you will see a vendor directory in the folder, which contains all the dependencies required by laravel.
php composer.phar install
If the network speed is slow, the installation time will be longer. We can back up this directory and just copy this folder directly during the next installation. After all, the dependencies here are not updated very frequently.
Permission settings
You need to set write permissions for files in the app/storage directory. Some framework directory paths can be set. If you need to change the location of these directories, you can view the settings in the bootstrap/paths.php
file.