首页 > 后端开发 > php教程 > Laravel框架学习 安装

Laravel框架学习 安装

WBOY
发布: 2016-06-20 12:44:18
原创
1137 人浏览过

    环境:mac os  10.10.5; php 5.6.9;

    文档参考: http://www.golaravel.com/

    包管理: python  一般使用 pip

    Laravel 利用 Composer(Composer 中文)来管理其自身的依赖包。

    安装:

lpe234@lpe234demacbookpro:/Users/lpe234  $ brew tap josegonzalez/homebrew-phpWarning: Already tapped!lpe234@lpe234demacbookpro:/Users/lpe234  $ brew install josegonzalez/php/composer==> Installing composer from josegonzalez/homebrew-php==> Downloading http://getcomposer.org/download/1.0.0-alpha10/composer.phar######################################################################## 100.0%==> CaveatsVerify your installation by running:  "composer --version".You can read more about composer and packagist by running:  "brew home composer".==> Summary?  /usr/local/Cellar/composer/1.0.0-alpha10: 3 files, 1.0M, built in 58 secondslpe234@lpe234demacbookpro:/Users/lpe234  $ composer --versionComposer version 1.0.0-alpha10 2015-04-14 21:18:51
登录后复制

Laravel 框架安装

lpe234@lpe234demacbookpro:/Users/lpe234  $ composer global require "laravel/installer=~1.1"Changed current directory to /Users/lpe234/.composer./composer.json has been createdLoading composer repositories with package informationUpdating dependencies (including require-dev)  - Installing symfony/process (v2.7.6)    Downloading: 100%  - Installing symfony/console (v2.7.6)    Downloading: 100%  - Installing guzzlehttp/promises (1.0.3)    Downloading: 100%  - Installing psr/http-message (1.0)    Downloading: 100%  - Installing guzzlehttp/psr7 (1.2.1)    Downloading: 100%  - Installing guzzlehttp/guzzle (6.1.0)    Downloading: 100%  - Installing laravel/installer (v1.2.2)    Downloading: 100%symfony/console suggests installing symfony/event-dispatcher ()symfony/console suggests installing psr/log (For using the console logger)Writing lock fileGenerating autoload files
登录后复制

安装完成之后,配置环境变量。

export PATH=$PATH:~/.composer/vendor/bin
登录后复制

然后验证是否成功。重启terminal

lpe234@lpe234demacbookpro:/Users/lpe234  $ laravel --versionLaravel Installer version 1.2.2
登录后复制

创建一个项目

lpe234@lpe234demacbookpro:/Users/lpe234/PhpstormProjects  $ laravel new blogCrafting application...Generating optimized class loaderApplication key [NhGlYwNWoJkRSW4ElhLghXy2FtAlZmBI] set successfully.Application ready! Build something amazing.
登录后复制


异常:

RuntimeExceptionin EncryptionServiceProvider.php line 29:

No supported encrypter found. The cipher and / or key length are invalid.


php artisan key:generate
登录后复制

然后将 生成的 32位key. 放到 config/app.php 下面的 APP_KEY  ;  以及 .env 中的 APP_KEY

之后  php artisan serve  错误依旧~~~~~~~






相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板