PHP framework Laravel learning experience

Source: Internet
Author: User
Tags php web development
Laravel is a simple and elegant PHP Web Development Framework (PHPWebFramework ). In the world (excluding China), PHP framework shares more than 40%. Next, I will share with you my learning experience on the PHP Framework Laravel. You are welcome to leave a message that Laravel is a simple and elegant PHP Web Development Framework (PHP Web Framework ). In the world (excluding China), PHP framework shares more than 40%.

I have been using Yii since I got started with PHP. I feel that Yii has a simple implementation function and is a good framework. I recently started to study Laravel5 for work reasons. I have to say that I am stuck in the first step of installation. below is my painful learning achievement. Laravel is completely new to me. if the content is incorrect, please leave a message or QQ to help me correct the error. thank you !!!

1. first install php, preferably version 5.6 or later.

(1)the php.exe path is specified in the composerprocess of Windows installation.

(2) the php-cli function must be used during the installation of composer in linux.

2. install composer

(1) install composer in windows

A. download the composer software in windows, and then click next until it is completed.
B. win + R => enter cmd => enter composer. if the composer font appears, the installation is successful.

(2) install composer in linux

A. $ curl-sS https://getcomposer.org/installer | php
B. At this time ~ /. Composer should generate the file composer. phar.
C. $ mv composer. phar/usr/local/bin/composer
D. move composer. phar to/usr/local/bin/composer globally. you can use composer directly without php composer. phar.
E. $ composer

3. modify the composer image source (recommended first)

(1) add the configuration information to the config. json configuration file of composer (global configuration of the system)

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

(2) add the configuration information to the composer. json file of a single project (single project configuration)

Note the last few rows of 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. install laravel

$ Composer create-project laravel/laravel learnlaravel5

The browser accesses localhost/learnlaravel5/public. if Laravel5 is displayed, the installation of laravel5 is successful.

The above content is a small part of the PHP framework Laravel's learning experience. This article is not well written. Please also give me some valuable comments and learn and make progress together.

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.