laravel 尝试在我的 Mac 上安装 Composer,Brew 失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22232075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Trying to install Composer on my Mac, Brew is failing
提问by Jason Ellis
I am trying to install Composer to use with Laravel on my Mac and I am following all the instructions I can find, but it's still failing.
我正在尝试在 Mac 上安装 Composer 以与 Laravel 一起使用,并且我正在按照我能找到的所有说明进行操作,但它仍然失败。
Command: php --version
命令: php --version
PHP 5.3.26 (cli) (built: Jul 7 2013 19:05:08)
PHP 5.3.26 (cli)(构建时间:2013 年 7 月 7 日 19:05:08)
I have php installed, albeit an older version.
我已经安装了 php,尽管是旧版本。
Command: brew install josegonzalez/php/composer
命令: brew install josegonzalez/php/composer
composer: Missing PHP53, PHP54 or PHP55 from homebrew-php. Please install one of them before continuing
作曲家:homebrew-php 中缺少 PHP53、PHP54 或 PHP55。请在继续之前安装其中之一
Requires php .. mm kay fine.
需要 php .. mm 没问题。
I tried installing the 53-intl that the composer documentation suggested.
我尝试安装 Composer 文档建议的 53-intl。
Command: brew install php53-intl
命令: brew install php53-intl
Error no available formula for bison27 (dependency of php53-intl) Searching taps... homebrew/versions/bison27
错误没有可用的 bison27 公式(依赖 php53-intl)正在搜索水龙头... homebrew/versions/bison27
It failed and I dont really understand the response.. so I'll try a new version of php.
它失败了,我真的不明白响应.. 所以我会尝试一个新版本的 php。
Command: brew install php55
命令: brew install php55
Error: You must `brew link libpng' before php55 can be installed
错误:在安装 php55 之前,您必须先“brew link libpng”
Okay.. Dependency issue.. no problem right?
好吧..依赖问题..没问题吧?
Command: brew link libpng
命令: brew link libpng
Linking /usr/local/Cellar/libpng/1.5.18... Warning: Could not link libpng. Unlinking... Error: Could not symlink file: /usr/local/Cellar/libpng/1.5.18/share/man/man3/libpngpf.3 /usr/local/share/man/man3 is not writable. You should change its permissions.
正在链接 /usr/local/Cellar/libpng/1.5.18... 警告:无法链接 libpng。正在取消链接...错误:无法符号链接文件:/usr/local/Cellar/libpng/1.5.18/share/man/man3/libpngpf.3 /usr/local/share/man/man3 不可写。您应该更改其权限。
It's 777'd.
它是 777'd。
I'm kind of at a loss..
我有点不知所措..
I tried unlinking and relinking libpng;
Command: brew unlink libpng
我尝试取消链接和重新链接 libpng;命令:brew unlink libpng
Unlinking /usr/local/Cellar/libpng/1.5.18... 0 links removed
取消链接 /usr/local/Cellar/libpng/1.5.18... 0 链接已删除
But unlinking didnt' appear to do anything.. and linking gave same error as above.
但是取消链接似乎没有做任何事情......并且链接给出了与上面相同的错误。
I have no idea how to proceed.. Thoughts?
我不知道如何进行.. 想法?
回答by Khashayar
First try:
第一次尝试:
brew tap homebrew/versions
Now run brew install php... again
现在再次运行 brew install php...
回答by Brad Decker
The solution for me was to do the following
我的解决方案是执行以下操作
brew untap homebrew/versions
brew update
brew tap homebrew/versions
brew update
the extra updates may or may not be necessary but i included them as it was my path to solving this issue!
额外的更新可能是也可能不是必要的,但我将它们包括在内,因为这是我解决此问题的途径!