安装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. js-回文数

    回文数 设n是一任意自然数.若将n的各位数字反向排列所得自然数n1与n相等,则称n为一回文数. //回文数 let readline = require("readline-sync&quo ...

  2. DX使用随笔--NavBarControl

    1. Item图标大小显示 需要先设置此Item所在Group的属性GroupStyle的值为LargeImageText.

  3. 6.单表的CRUD操作

    1.插入后用新id初始化被插入对象 <insert id="insertStudentCatchId"> insert into student (age,name,s ...

  4. Impala 中invalidate metadata和refresh

    首先了解一下:Impala如何融入Hadoop生态系统 Impala使用了Hadoop生态系统中许多熟悉的组件.Impala可以作为消费者和生产者与其他Hadoop组件交换数据,因此它可以以灵活的方式 ...

  5. select —— poll —— epoll

      import socket,select s=socket.socket() s.setblocking(False) s.setsockopt(socket.SOL_SOCKET,socket. ...

  6. 第四章、Django之模型层---创建模型

    目录 第四章.Django之模型层---创建模型 一.写models.py 第四章.Django之模型层---创建模型 一.写models.py from django.db import model ...

  7. 【3】Kafka安装及部署

    一.环境准备 Linux操作系统 Java运行环境(1.6或以上) zookeeper 集群环境,可参照Zookeeper集群部署 . 服务器列表: 配置主机名映射. vi /etc/hosts ## ...

  8. 【转载】interpolation(插值)和 extrapolation(外推)的区别

    根据已有数据以及模型(函数)预测未知区域的函数值,预测的点在已有数据范围内就是interpolation(插值), 范围外就是extrapolation(外推). The Difference Bet ...

  9. java lambda 所有列求和

    今天做东西的时候遇到一个需求,求list集合所有列的求和.折腾半天也没有搞出来,网上大部分都是单列求和就像下面这样的,其他都差多,什么 min,max avg count 只得到了number这个属性 ...

  10. 013.子查询和分页子查询(sql实例)

    --1 子查询 如果子查询和表连接都实现的时候,推荐用表连接实现( 一般:能用表连接实现的就用表连接,有些情况用表连接不能 或者不易实现的再选择子查询) 系统:缓存,执行计划技术手段 --1 wher ...