Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation method of Laravel5.3

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains the "installation method of Laravel5.3", the content of the explanation is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "the installation method of Laravel5.3"!

1. Server requirements

The Laravel framework has a few server requirements, and of course, Laravel Homestead already meets all of these requirements, so we strongly recommend using Homestead as the Laravel native development environment (or Valet as the local development environment for Mac).

However, if you are not using Homestead, you need to make sure that your 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, so make sure that Composer is installed on the machine before using Laravel.

Through the Laravel installer

First, install the Laravel installer through Composer:

Composer global require "laravel/installer"

Make sure that ~ / .composer/vendor/bin is in the system path, otherwise you cannot call the laravel command on any path.

After installation, a new Laravel application can be created in the current directory with a simple laravel new command. For example, laravel new blog will create a new application called blog with all Laravel dependencies. This installation method is much faster than installing through Composer:

Laravel new blog

Through Composer Create-Project

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

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

3. Configuration

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

Public directory

After installing Laravel, you need to point the web root directory of the HTTP server to the public directory. The index.php file in this 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, so you can easily navigate through these configuration files to familiarize yourself with all configuration items.

Directory permissions

After installing Laravel, you need to configure read and write permissions for some directories: the storage and bootstrap/cache directories should be writable, and if you use the Homestead virtual machine as your development environment, these permissions are already set.

Apply Key

The next thing to do is to set the application's key (APP_KEY) to a random string, and if you installed it through Composer or Laravel installer, the value of the key has been generated by the php artisan key:generate command.

In general, the string should be 32 bits long and configured through APP_KEY in the .env file. If you haven't renamed the .env.example file to .env, do so now. If the application key is not set, the user Session and other encrypted data will have security risks.

More configuration

Laravel hardly needs any other configuration to work properly, but you'd better take a look at the config/app.php file, which contains some configurations that may need to be changed based on the application, such as timezone and locale (for configuring the time zone and localization, respectively).

You may also want to configure some other components of Laravel, such as caching, database, Session, etc., which we will discuss in later documents.

After the installation is complete, you can proceed to the next step-configuring Laravel.

Thank you for your reading, the above is the content of "the installation method of Laravel5.3", after the study of this article, I believe you have a deeper understanding of the installation method of Laravel5.3, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report