Summary of three installation methods of Laravel and the installation method of laravel

Source: Internet
Author: User
Tags php framework

Summary of three installation methods of Laravel and the installation method of laravel

Laravel is known as the master PHP framework. More and more PHPer chooses it as the development framework. As a Laravel beginner, I believe many people will be installed and blocked like me. So today I will summarize the installation method of Laravel based on my documents and my own learning experience. I hope you will not take any detours when learning Laravel. Laravel installation methods can be divided into the use of Composer installation and one-click installation package installation.

The simplest installation method is to install Laravel using a one-click installation package.

In order to facilitate beginners to learn Laravel has a great God on the Internet provides a one-key installation package (download URL: http://www.golaravel.com/download/) installed very convenient to download the compressed package directly decompress your own project deployment directory can be used, by the way, the Laveral entry file is the index under Public. php, and the server under the project root directory. php. After installation, you can directly access XXX/public to see the welcome page of Laravel. Laravel has certain requirements on the environment, so be sure to check whether your operating environment meets the requirements before installation (Environmental Requirements: http://laravel-china.org/docs/5.1/installation ).

The following describes how to install Composer, which is a headache for beginners.

The Composer official website introduces it as follows: "Composer is a dependency management tool of PHP. It allows you to declare the code library on which the project depends, and it will install them for you in your project ". For a pure PHPer, Composer is hard to understand. It is equivalent to yum in liunx and Maven in Java. This may be a bit General. Let's look back at our development experience. When developing a user registration module, we need to send a verification email to the user registration email address, think about how we do it. Download the PHPMailer package from the Internet and place it in the corresponding position of the Project for calling. At this time, PHPMailer is the dependency we developed. The emergence of Composer aims to solve this dependency, you only need to run a command line command with a slight configuration to automatically install the dependent package into our project (a bit like Pear ). There is also a hurdle for installing Laravel using Composer, which is "wall". I will explain it to you later when installing it. If you fail to install Composer, refer to the environment requirements of Laravel. It may be that some extensions in your environment are not enabled or installed.

There are also two ways to install with Composer.

1. Use Laravel Installation tool to install the tool (Copy the content in the Manual)

1. Use Composer to download the Laravel installation package:

 

composer global require "laravel/installer"

 

(After Composer is installed, you can enter Composer in the command line. For example, the above command is provided by the Composer command line tool)

2. After the download is complete, you can use the Installation tool provided by Laravel to install it (it is also a command line tool, so please be sure you have~/.composer/vendor/binAdd the PATH to the PATH. Only in this way can the system find the PATH.laravel. I added it automatically during installation. After the installation is complete, enter Laravel in the command line. If the prompt is not an internal system command, you need to manually configure it)

 

For example, to create a blog project, switch the command line to the project deployment location for running:laravel new blogAblogDirectory, which stores the newly installed Laravel and code dependencies. (The installation speed of this method is much faster than that of using Composer. Laravel's Installation tool provides a foreign image and does not seem to be able to be changed, because of the existence of the wall, whether the installation can be successful depends on the character)

laravel new blog

2. Use Composer Create-Project.

 

Use Composer to run on the command linecreate-projectCommand to install Laravel:

 

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

In this way, the installation of the default source is also a foreign image, it will be very slow to install, but fortunately there is a solution, that is, to change the source to a domestic image. Participate in renewal for specific modification methods.

 

If something is wrong, I hope you can correct it.

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.