Laravel5 framework learning environment and configuration, laravel5 framework environment _ PHP Tutorial

Source: Internet
Author: User
Laravel5 framework learning environment and configuration. Laravel5 framework learning environment and configuration. the env file is the configuration file, including database configuration information, view config-database.php, connections contains the Laravel 5 framework learning environment and configuration, laravel5 framework environment

The. env file is a configuration file, including the database configuration information. View config-> database. php. connections contains the configuration of all databases. you can select the database to use in default. In database configuration, env ('Db _ host', 'localhost') is used to read the. env configuration file. The second parameter is the default parameter.

We use the mysql database to modify. env:

DB_HOST=localhostDB_DATABASE=laravelDB_USERNAME=rootDB_PASSWORD=

Create a laravel database in mysql

mysql -u root CREATE DATABASE laravel

View mysql configuration:

  'mysql' => [  'driver'  => 'mysql',  'host'   => env('DB_HOST', 'localhost'),  'database' => env('DB_DATABASE', 'forge'),  'username' => env('DB_USERNAME', 'forge'),  'password' => env('DB_PASSWORD', ''),  'charset'  => 'utf8',  'collation' => 'utf8_unicode_ci',  'prefix'  => '',  'strict'  => false, ],

The config subdirectory contains all the configuration files.

The above is all the content of this article, hoping to help you learn the Laravel5 framework.

Http://www.bkjia.com/PHPjc/980215.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/980215.htmlTechArticleLaravel 5 framework learning environment and configuration, laravel5 framework environment. env file is the configuration file, including the database configuration information, view the config-database.php, connections contains...

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.