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 the learning of my PHP framework Laravel.

Laravel is a simple and elegant PHP Web development Framework ). In the world (excluding China), PHP framework shares more than 40%. Next, I will share with you the learning of my PHP framework Laravel.

Laravel is a simple and elegant PHP Web development 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

(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.