PHP框架Laravel学习心得体会

前端之家收集整理的这篇文章主要介绍了PHP框架Laravel学习心得体会前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Laravel是一套简洁、优雅的PHP Web开发框架 (PHP Web Framework) 。在世界(不含中国)PHP框架的占有率超过40%。

自从接触PHP以来一直使用Yii,感觉Yii实现功能比较简单,是一个很不错的框架。最近由于工作的原因开始研究Laravel5,不得不说我在第一步安装就被坑着了,下面就是我痛苦的学习成果。Laravel对我来说完全是新东西,如果内容有误,烦请留言或QQ我,帮我纠正错误,感激不尽!!!

PHP,最好5.6以上版本

(1)windows安装composer过程中需要指定PHP.exe的路径

(2)linux安装composer过程中需要利用PHP-cli功能

(1)windows安装composer

a.windows下载composer软件,然后next直到完成 b.win+R => 输入cmd => 输入composer,如果出现composer字体表示安装成功

(2)linux安装composer

a.$ curl -sS | php b.此时在~/.composer下应该会产生composer.phar 这个文件 c.$ mv composer.phar /usr/local/bin/composer d.将composer.phar移动成/usr/local/bin/composer全局下,以后可以直接使用composer,而不需要php composer.phar e.$ composer

(1)将配置信息添加到 composer 的配置文件 config.json 中(系统全局配置)

    $composer config -g repositories.packagist composer

(2)将配置信息添加到单个项目的 composer.json 文件中(单个项目配置)

注意最后几行repositories

PHP;"> { 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} ] }

$ composer create-project laravel/laravel learnlaravel5

浏览器访问localhost/learnlaravel5/public,出现Laravel5表示laravel5安装成功

以上内容是小编给大家分享PHP框架Laravel学习心得体会,本文写的不好,还请给位大侠给我提出宝贵意见,共同学习进步。

猜你在找的Laravel相关文章