安装laravel之前先安装composer

  使用 curl 指令下载:

    curl -sS https://getcomposer.org/installer | php

  或是沒有安裝 curl ,也可以用 php 指令下载:

    php -r "readfile('https://getcomposer.org/installer');" | php 

  当你下载了 composer.phar 后,可以将它放在目录中,但每次当你建立新目录时,你必須再复制一个副本到新目录中,这样比较麻烦。所以最佳做法是将它放到 usr/local/bin 目录中中,成为全域指令。 
    mv composer.phar /usr/local/bin/composer 

  

  之后会在当前文件夹产生composer.phar把他放进 /usr/local/bin/composer

  在~/.bash_profile/usr/local/bin添加到环境变量

    vi ~/.bash_profile

    export PATH=/usr/local/bin:$PATH
 
  使用composer 安装 laravel


输入composer global require "laravel/installer=~1.1"命令查看

composer global require "laravel/installer=~1.1"

Changed current directory to /Users/yangyanqing/.composer

./composer.json has been created

Loading composer repositories with package information

Updating dependencies (including require-dev)

Package operations: 10 installs, 0 updates, 0 removals

- Installing symfony/process (v4.1.1): Downloading (100%)

- Installing symfony/polyfill-ctype (v1.8.0): Downloading (100%)

- Installing symfony/filesystem (v4.1.1): Downloading (100%)

- Installing symfony/polyfill-mbstring (v1.8.0): Downloading (100%)

- Installing symfony/console (v4.1.1): Downloading (100%)

- Installing guzzlehttp/promises (v1.3.1): Downloading (100%)

- Installing psr/http-message (1.0.1): Downloading (100%)

- Installing guzzlehttp/psr7 (1.4.2): Downloading (100%)

- Installing guzzlehttp/guzzle (6.3.3): Downloading (100%)

- Installing laravel/installer (v1.5.0): Downloading (100%)

symfony/console suggests installing psr/log-implementation (For using the console logger)

symfony/console suggests installing symfony/event-dispatcher ()

symfony/console suggests installing symfony/lock ()

guzzlehttp/guzzle suggests installing psr/log (Required for using the Log middleware)

Writing lock file

Generating autoload files

输入laravel命令查看

laravel

Laravel Installer 1.5.0

Usage:

command [options] [arguments]

Options:

-h, --help            Display this help message

-q, --quiet           Do not output any message

-V, --version         Display this application version

--ansi            Force ANSI output

--no-ansi         Disable ANSI output

-n, --no-interaction  Do not ask any interactive question

-v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:

help  Displays help for a command

list  Lists commands

new   Create a new Laravel application.

1、进入到设置的根目录

cd /Users/username/wwwroot

2、此时可以使用 laravel new 命令建立一份全新安装的 Laravel 应用,

例如: laravel new blog 将会在当前目录下建立一个名为 blog 的目录,

此目录里面存放着全新安装的 Laravel 相关代码,

此方法跟其他方法不一样的地方在于会提前安装好所有相关代码,

不需要再通过 composer install 安装相关依赖,速度会快许多。

laravel new blog

或者

通过 Composer Create-Project,你一样可以通过 Composer 在命令行执行 create-project 来安装 Laravel:

composer create-project laravel/laravel --prefer-dist

3、打开浏览器: http://localhost/blog/publi

如果报错,需要给权限

chmod -R -777 blog

参考:

https://blog.csdn.net/u013664733/article/details/54343768

 https://www.fujieace.com/laravel/mac-2.html
https://blog.csdn.net/biyongyao/article/details/76652677
 
 

mac 安装laravel的更多相关文章

  1. laravel(一):如何安装laravel

    1.前提条件 本文针对想从零开始开发 Laravel 程序的初学者,不需要预先具备任何的 Laravel 使用经验.不过,为了能顺利阅读,还是需要事先安装好一些软件: PHP 5.4 及以上版本 包管 ...

  2. Mac安装LNMP环境,升级php7

    Mac安装nginx+mysql+php 安装nginx比较麻烦,要安装pcre       ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre ...

  3. 解决安装laravel/homestead vagrant环境报"A VirtualBox machine with the name 'homestead' already exists."的错误

    之前在mac上安装laravel/homestead vagrant虚拟机环境时由于参照的教程是: 每次都必须在~/Homestead目录下边运行vagrant up/halt命令,觉得实在是不方便, ...

  4. 使用国内镜像composer安装laravel

    1.安装 Laravel,创建blog项目 首先先说一下直接安装的方法,要想使用这个方法,首先要FQ(这是我们的基本国情决定的).这样的安装方式有两种: ①.全局安装 使用命令Laravel Inst ...

  5. composer镜像安装laravel

    博主最近在学习Laravel的框架的相关知识,对于Laravel的许多新特性,大家最好还是去查看官网文档最好,Laravel的文档非常完善,中文英文的都有,可以很好的解决你的困惑. 但是我们会发现学习 ...

  6. windows安装Laravel框架经验心得(一)

    作为一个程序员,要活到老学到老.虽然自己水平很菜,但是也要继续往前走,所以打算利用一些空闲时间在学习一些新知识,比如Laravel框架. 看书费劲,好不容易找到了一些关于Laravel的教学视频.不过 ...

  7. mac安装tensorflow报错

    问题:mac安装tensorflow过程中,爆出oserror:permission denied 解决方案:关闭mac的sip,然后sudo安装 关闭sip的方法:重启mac,按住command+R ...

  8. Mac 安装activate-power-mode atom

    Mac 安装activate-power-mode atom 标签: atommac 2015-12-02 14:53 308人阅读 评论(0) 收藏 举报  分类: git(2)  版权声明:本文为 ...

  9. Mac安装ctags

    Mac安装ctags mac 系统有自带的ctags,但是不支持"ctags -R"指令,需要自己在安装Exuberant Ctags 1.下载ctags 2. 安装 ./conf ...

随机推荐

  1. tomcat 的配置文件server.xml 几个端口的作用

    tomcat中server.xml配置文件中几个port的作用和区别 在tomcat的server.xml中有这么几个port,很多人虽然一直在使用tomcat,但是却不知道这几个port各有什么作用 ...

  2. K2 BPM_如何将RPA的价值最大化?_全球领先的工作流引擎

     自动化技术让企业能够更有效的利用资源,减少由于人为失误而造成的风险损失.随着科技的进步,实现自动化的途径变得更加多样化. 据Forrester预测,自动化技术将在2019年成为引领数字化转型的前沿技 ...

  3. ESP8266开发环境、编译、烧录

    官方地址 中:http://www.espressif.com/zh-hans/support/download/overview?keys=&field_type_tid[]=14 英:ht ...

  4. JS中call()和apply()以及bind()的区别

    一.方法定义: apply:调用一个对象的一个方法,用另一个对象替换当前对象.例如:B.apply(A, arguments);即A对象应用B对象的方法. call:调用一个对象的一个方法,用另一个对 ...

  5. IDEA设置CodeGlance颜色

    CodeGlance是IDEA的mini地图插件, 默认情况下, 其颜色和编辑框的颜色基本一致, 而安装CodeGlance就是为了方便滚动框的上下拖拉, 颜色一致的话会将这种CodeGlance比拖 ...

  6. myeclipse 关闭jsp悬浮提示

    myeclipse越来越智能,身为码农的我却越来越伤心.虽然你很智能,但请你提供一些有用的信息给我,不要乱七八槽的,不问青红皂白就塞一大堆提示给我,对不起,哥不需要这些!!! 都知道,使用myecli ...

  7. C语言之const

    鱼鹰  鱼鹰谈单片机 2月19日 预计阅读时间: 5 分钟 我们知道,数据分为两种,一种为只读,一种为可读可写,为了防止一些不变的数据被程序意外的修改,有必要对它进行保护.这就是 const 的作用. ...

  8. smarty模板使用

    安装配置 下载smarty模板核心类库,把libs文件夹复制到项目文件夹下,修改为smarty在php文件中调用 require '../smarty/Smarty.class.php';$tpl = ...

  9. ACM-ICPC 2016 沈阳赛区现场赛 I. The Elder && HDU 5956(斜率DP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5956 题意:一颗树上每条边有个权值,每个节点都有新闻要送到根节点就是1节点,运送过程中如果不换青蛙就是 ...

  10. HDU 6078 - Wavel Sequence | 2017 Multi-University Training Contest 4

    /* HDU 6078 - Wavel Sequence [ DP ] | 2017 Multi-University Training Contest 4 题意: 给定 a[N], b[M] 要求满 ...