Installation of Laravel 5.3 learning notes, laravel5.3

Source: Internet
Author: User

Installation of Laravel 5.3 learning notes, laravel5.3

1. Server Requirements

The Laravel framework has a few requirements on servers. Of course, Laravel Homestead has already met all these requirements, therefore, we strongly recommend using Homestead as the Laravel Local Development Environment (Valet can also be used as the local development environment for Mac ).

However, if you are not using Homestead, make sure that the development environment meets the following requirements:

PHP version> = 5.6.4
PHP Extension: OpenSSL
PHP Extension: PDO
PHP Extension: Mbstring
PHP Extension: Tokenizer

2. Install Laravel

Laravel uses Composer to manage dependencies. Therefore, before using Laravel, ensure that Composer is installed on the machine.

Use Laravel Installer

First, install Laravel installer through Composer:

composer global require "laravel/installer"

Ensure ~ /. Composer/vendor/bin is in the system path. Otherwise, the laravel command cannot be called in any path.

After the installation is complete, use the simple laravel new command to create a new Laravel application in the current directory. For example, laravel new blog will create a new application named blog, all Laravel dependencies are included. This installation method is much faster than using Composer:

laravel new blog

PassComposer Create-Project

You can also use the create-project command of Composer in the terminal to install the Laravel application:

composer create-project --prefer-dist laravel/laravel blog

3. Configuration

All configuration files of the Laravel framework are stored in the config directory, and every configuration item has annotations. Therefore, you can browse any configuration file to familiarize yourself with these configuration items.

Public directory

After Laravel is installed, you need to direct the web root directory of the HTTP server to the public directory. The index. php file under the directory will be used as the front-end controller, and all HTTP requests will enter the application through this file.

Configuration File

All configuration files of the Laravel framework are stored in the config directory, and all configuration items are annotated. Therefore, you can easily view these configuration files to familiarize yourself with all configuration items.

Directory permission

After installing Laravel, You need to configure read and write permissions for some directories: the storage and bootstrap/cache Directories Should be writable. If you use the Homestead virtual machine as the development environment, these permissions have been set.

Application Key

The next thing to do is to set the key (APP_KEY) of the application to a random string. If you install the key through the Composer or Laravel installer, the value of the key has been passed through the php artisan key: the generate command is generated.

Generally, this string should be 32-bit long and configured through the APP_KEY in the. env file. If you have not renamed the. env. example file to. env, do this now. If the application key is not set, the user Session and other encrypted data may have security risks.

More configurations

Laravel can be used normally without any other configuration, but you 'd better check config/app again. php file, which contains some configuration that may need to be changed based on the application, such as timezone and locale (used to configure the time zone and localization respectively ).

You may also want to configure other components of Laravel, such as cache, database, and Session. We will discuss these components in subsequent documents.

After the installation is complete, go to the next step-configure Laravel.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.