Detailed steps for installing the laravel development framework in China
Server Requirements #
The Laravel framework has some system requirements. Make sure that the following extensions are installed on your server:
PHP >= 5.6.4 OpenSSL PHP Extension PDO PHP Extension Mbstring PHP Extension Tokenizer PHP Extension XML PHP Extension
Note: It is strongly recommended that Homestead be used as a development environment, especially for beginners, to avoid unnecessary troubles. For the online environment, see the Homestead environment deployment script.
Install Laravel #
Laravel uses Composer to manage code dependencies. Therefore, before using Laravel, make sure that Composer is installed on your computer.
Install the tool through Laravel #
First, use Composer to download the Laravel installation package:
composer global require "laravel/installer"
Make sure you have~ /. Add the composer/vendor/bin PATH to the PATH. Only in this way can the system find the laravel execution file.
There is a wall in China, so we need to use the domestic source:
Modify the global configuration file of composer (Recommended Methods)
Open the command line window (windows User) or Console (Linux, Mac user) and execute the following command: composer config-g repo. packagist composer https://packagist.phpcomposer.com
Once the installation is complete, you can use the laravel new command to create a new Laravel project in the specified directory. For example, laravel new blog will create a directory named blog in the current directory, this directory contains the newly installed Laravel and code dependencies. The installation speed of this method is much faster than that of using Composer:
laravel new blog
Because code dependencies are directly packaged and installed together.
You can also use Composer to run the create-project command on the command line to install Laravel:
composer create-project --prefer-dist laravel/laravel blog