PHP Framework Laravel Learning Experience _php Example

Source: Internet
Author: User
Tags autoload php framework php web development windows download
Laravel is a simple, elegant PHP Web development Framework (PHP Web framework). In the world (excluding China) The PHP framework has a share of more than 40%.

Yii has been used since the contact with PHP, and it is a good framework to feel that the YII implementation function is relatively simple. Recently, because of the cause of work began to study Laravel5, I have to say that I installed in the first step is a pit, the following is my painful learning results. Laravel for me is completely new things, if the content is wrong, please leave a message or QQ me, help me correct the mistake, grateful!!!

1. First install PHP, preferably more than 5.6 version

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

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

2. Installing composer

(1) Windows installation composer

A.windows Download composer Software, then next until finished
B.win+r = input cmd = input composer If a composer font appears indicating successful installation

(2) Linux installation composer

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

3. Modify the composer Image source (recommended first)

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

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

(2) Adding configuration information to a single project's Composer.json file (single item configuration)

Note the last few lines repositories

{Name ":" Laravel/laravel "," description ":" The Laravel framework. "," keywords ": [" Framework "," Laravel "]," license ": "MIT", "type": "Project", "require": {"PHP": ">= ...", "Laravel/framework": ". * "}," Require-dev ": {" Fzaninotto/faker ":" ~. "," Mockery/mockery ":".  * "," Phpunit/phpunit ":" ~. "," Phpspec/phpspec ":" ~. "    }, "AutoLoad": {"Classmap": ["Database"], "psr-": {"app\\": "App/"}}, "Autoload-dev": {       "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.example ', '. env '); \ ""],  "Post-create-project-cmd": ["PHP Artisan Key:generate"]}, "config": {"Preferred-install": "Dist"}, "Repositories": [{"Type": "composer"," url ":" Http://packagist.phpcomposer.com "}, {" Packagist ": false}]} 

4. Installing Laravel

$ composer Create-project Laravel/laravel Learnlaravel5

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

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

  • Related Article

    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.