I. Installation of composer
First you need to install Composer,composer is a PHP dependency management tool, Laravel Framework is to use Composer to perform installation and dependency management.
Note:
(1) If the installation composer error, open the Php_openssl,php_fileinfo extension in the php.ini, because Laravel need.
(2) During the installation process, choose the correct php.exe position
Two. Install Laravel
Composer installation is complete, in cmd, your website directory executes the following command:
- Composer Create-project Laravel/laravel Your-project-name
Composer will automatically help you download Laravel and install.
Three. Deploying a virtual Host
For example, my project name is Project:
- <virtualhost *:80>
- DocumentRoot "E:/www/project/public"
- ServerName Laravel.dev
- ErrorLog "Logs/laravel.log"
- Customlog "Logs/laravel.log" common
- </VirtualHost>
Of course, you also need to bind the domain name in your hosts:
- 127.0.0.1 Laravel.dev
At this point, the installation is complete:
Four. Realize Hello World
Print Hello world with routing implementation, add in app/routes.php:
- Route::get (' Test ', function ()
- {
- Return ' Hello world! ';
- });
Because the Laravel template uses a blade, so in the following tutorial to introduce controller or view-related!