How to install composer using brew
This article mainly introduces how to use brew to install composer, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
To view the PHP version on the terminal, Composer requires PHP version 5.3.2 + and some configuration of PHP.
PHP 5.5.26 (cli) (built: Jul 6 2015 14:26:26) Copyright (c) 1997-2015 The PHP GroupZend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies with Xdebug v2.2.7, Copyright (c) 2002-2015, by Derick Rethans
Input at the terminal
Brew install composer
There is a problem:
/ 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!
Solution: click to view
Method 1:
Brew upgrade and then brew update.
Method 2:
Cd "$(brew-- repository)" & & git fetch & & git reset-- hard origin/master
After the problem is resolved, install using brew install homebrew/php/composer
After installing composer successfully, I want to install laravel/installer
Composer global require "laravel/installer"
After the installation is successful, use the command laravel, but the zsh: command not found: laravel is displayed
Solution:
/ / I use oh-my-zsh. Add the following export PATH= "/ Applications/MAMP/bin/php/php5.5.26/bin:$PATH:$HOME/.composer/vendor/bin/" in ~ / .zshrc. Thank you for reading this article carefully. I hope the article "how to use brew to install composer" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!