使用brew安裝composer

在終端查看PHP版本Composer要求 PHP 5.3.2+ 版本以及一些PHP的配置php

PHP 5.5.26 (cli) (built: Jul  6 2015 14:26:26)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
    with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans

在終端輸入laravel

brew install composer

出現問題:git

/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
[etc..]
Error: update-report should not be called directly!

解決方法:點擊查看composer

方法1:fetch

brew upgrade 而後 brew updateui

方法2:debug

cd "$(brew --repository)" && git fetch && git reset --hard origin/mastercode

解決問題後,使用brew install homebrew/php/composer安裝homebrew

安裝composer成功後,我想安裝laravel/installerget

composer global require "laravel/installer"

安裝成功後,使用命令laravel, 可是會顯示zsh: command not found: laravel

解決辦法:

//我用的是oh-my-zsh, 在~/.zshrc添加以下

export PATH="/Applications/MAMP/bin/php/php5.5.26/bin:$PATH:$HOME/.composer/vendor/bin/"
相關文章
相關標籤/搜索