Summary of three kinds of installation methods for Laravel

Source: Internet
Author: User
Tags php framework

Laravel is known as the master-level PHP framework, more and more phper choose it as a development framework, as a laravel beginners believe that many people like me to be installed outside the door. So today combined with the document and their learning experience to sum up the Laravel installation method, I hope that we learn laravel less to go some detours. Laravel installation method Large to cent can be divided into the use of composer installation and one-click installation package installation.

First of all, the simplest installation method, the use of a key installation package to install Laravel.

In order to facilitate beginners to learn laravel has great God on the Internet to provide a key installation package (download URL: http://www.golaravel.com/download/) installed very convenient to download the compressed package directly to their own project deployment directory can be used, By the way, take a look at the Laveral entry file for the public under the index.php, and the project root directory under the server.php, that is, after the installation of direct access to Xxx/public can see the Laravel welcome page. Laravel have certain requirements for the environment so before installation, be sure to check your operating environment to meet the requirements (environmental requirements to participate in: http://laravel-china.org/docs/5.1/installation).

Here is the best way to install the headache for beginners, using composer installation.

Composer official website On its introduction is this: "Composer is a PHP dependency management tool." It allows you to affirm that the project relies on the code base that it will install for you in your project. For a pure phper, composer is not easy to understand, it is equivalent to the liunx in the Yum,java of Maven. This may be a little more general, let's think about our development experience, when we develop a user registration module, we need to send a user to register a mail message, think about how we do. Go online to download the Phpmailer package and put it in the appropriate location of the project to call where you need it. This time Phpmailer is the dependency that we develop, the presence of composer in order to resolve this dependency, only a little configuration to run a command-line command can automatically install the dependency pack into our project (a bit like pear). The use of composer installation Laravel there is a ridge that is "wall", not much to say when the installation of the time to explain. If you install composer failure You can refer to a laravel environmental requirement, possibly some of the extensions in your environment are not open or installed.

There are also two ways to install with composer.

First, use the Laravel installation tool to install (the contents of the direct copy manual)

1, download Laravel installation package using Composer:

Composer global require "Laravel/installer"

(After installing the composer, you can enter the composer on the command line, the above command is provided by the composer command-line tool) 2, after the download is complete, you can use the installation tools provided by Laravel (also command-line tools, so make sure you have ~/.) The Composer/vendor/bin path is added to path, only so the system can find the Laravel execution file. I installed the time is automatically added, all of you after the installation is completed at the command line input laravel to try, if the hint is not a system internal command then you need to manually configure it!

For example, to do a blog project, switch the command line to the project deployment location: Laravel New blog will create a directory called blogs in the current directory, which holds the newly installed Laravel and code dependencies. (This method of installation faster than through the Composer installation of many, Laravel installation tools provided by the source is a foreign mirror and seems to be unable to change, because of the existence of the wall can be installed to see the character of success)

Laravel New Blog
Second, the use of composer Create-project.

Install Laravel by running the create-project command at the command line Composer:

Composer Create-project Laravel/laravel--prefer-dist Blog
This way to install the default source is also a foreign mirror installation will be very slow, fortunately there is a solution, that is to change the source to the domestic mirror. Specific modification methods to participate in http://pkg.phpcomposer.com/, if you modify the mirror or installation can not be installed then use a key to install the package it, first use up again, later to play.

There are some wrong places to hope that you will correct me.

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.