PHP Framework Laravel Learning Experience _php Example

Source: Internet
Author: User
Tags autoload install php php framework php web development windows download yii

Laravel is a concise, elegant PHP Web development Framework (PHP Web framework). In the world (excluding China) PHP framework has a share of more than 40%.

Since the touch of PHP has been using yii, feeling YII implementation is relatively simple, is a very good framework. Recently, due to the work of the reasons to start research Laravel5, I have to say that I was in the first installment was a pit, the following is my painful learning results. Laravel is completely new to me, if the content is wrong, please leave a message or QQ me, help me correct the error, grateful!!!

1. First install PHP, preferably more than 5.6 version

(1) You need to specify the Php.exe path during Windows installation composer

(2) Linux installation composer process needs to use the PHP-CLI function

2. Install composer

(1) Windows installation composer

A.windows Download the composer software and then next until you finish
B.win+r => input cmd => input composer, if composer font indicates successful installation

(2) Linux installation composer

a.$ Curl-ss Https://getcomposer.org/installer | Php
B. Composer.phar This file should be generated at this time under ~/.composer
c.$ MV Composer.phar/usr/local/bin/composer
D. Move the Composer.phar to the/usr/local/bin/composer global, then you can use the composer directly, without the need for PHP Composer.phar
e.$ composer

3. Modify the composer Mirror source (recommended first)

(1) Add configuration information to the composer Profile Config.json (System global Configuration)

$composer config-g repositories.packagist composer http://packagist.phpcomposer.com

(2) Add configuration information to the Composer.json file of a single project (single project configuration)

Note the last few lines repositories

{Name ":" Laravel/laravel "," description ":" The Laravel framework. "," keywords ": [Framework, Laravel]," lice NSE ": MIT", "type": "Project", "require": {"PHP": ">= ...", "Laravel/framework": ". * "}," Require-dev ": {" Fzaninotto/faker ":" ~. "," Mockery/mockery ":".
  * "," Phpunit/phpunit ":" ~. "," Phpspec/phpspec ":" ~. " }, "AutoLoad": {"Classmap": ["Database"], "psr-": {"app\\": "App/"}}, "Autoload-de V ": {" Classmap ": [" tests/testcase.php "]}," scripts ": {" Post-install-cmd ": [" PHP Artisan
    Clear-compiled "," PHP artisan optimize "]," pre-update-cmd ": [" PHP artisan clear-compiled "], "Post-update-cmd": ["PHP artisan Optimize"], "Post-root-package-install": ["php-r \" Copy ('. Env.ex
    Ample ', '. env '); \ ""], "post-create-project-cmd": ["PHP Artisan Key:generate"]}, "config": { "Preferred-install": "DIst '}, ' repositories ': [{' type ': ' composer ', ' url ': ' http://packagist.phpcomposer.com '}, {' Packagist ': false }
  ]
}

4. Install Laravel

$ composer Create-project Laravel/laravel Learnlaravel5

Browser Access Localhost/learnlaravel5/public, Laravel5 indicates LARAVEL5 installation succeeded

The above content is small to share the PHP framework Laravel learning experience, this article is not good, please give me a hero to give my valuable advice, common learning progress.

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.