: This article mainly introduces Laravel of PHP framework learning. For more information about PHP tutorials, see. 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. install php first. it is best to set php.exe path in version 5.6 or later (1)windowsinstall composerprocess (2) php-cli function 2 should be used during the installation of composer in linux. install composer (1) install composer in windows. in windows, download the composer software and next until B is completed. win + R => enter cmd => enter composer. if the composer font appears, the installation is successful. (2) install composer in linux. $ curl-sS https://getcomposer.org/installer | php B. at this time ~ /. Composer should be generated under composer. phar file c. $ mv composer. phar/usr/local/bin/composer d. set composer. phar is moved to the Global Directory of/usr/local/bin/composer. 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 composer configuration file.config.json
Medium (global system configuration)
$composer config -g repositories.packagist composer http://packagist.phpcomposer.com
(2) add the configuration information tocomposer.json
File (single project configuration) pay attention to the last few linesrepositories
{ name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": ">=5.5.9", "laravel/framework": "5.1.*" }, "require-dev": { "fzaninotto/faker": "~1.4", "mockery/mockery": "0.9.*", "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1" }, "autoload": { "classmap": [ "database" ], "psr-4": { "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 introduces Laravel of PHP framework learning, including The require content, and hopes to help friends who are interested in PHP tutorials.