这几天,homebrew-php 仓库大部分扩展都干掉了,等几天吧,看主仓库会不会再加回这些干掉的扩展,不然就只能自己编译安装了
homebrew-php 基本迁移到了 homebrew-core,php72 (默认为 php )已经自带编译了一些扩展,另一些不常用的,需要自己 pecl 安装(官方是这么说的)
由于homebrew 自带是国外源,在国内做很多操作都会很慢
1.替换 homebrew-core源
我这里用的中科大,如果需要清华大学的请出门左拐
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
2.替换 Homebrew Bottles源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
brew update
1.打开网址
输入github密码之后直接点击Generate Token生成token
2.复制token并且导入github token
export HOMEBREW_GITHUB_API_TOKEN="生成的token"
3.brew update
brew update检测速度是否会快,并且会不会报错
brew update
Unable to determine linked PHP
github网上说需要
brew link php71
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/php@7.1/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/usr/local/opt/php@7.1/sbin:$PATH"' >> ~/.zshrc
然后我加了环境变量也没用,最后还是报错
Unable to determine linked PHP
ln -s /usr/local/Cellar/php/7.2.4/bin/php /usr/local/bin/php
$ valet install
Password:
Stopping nginx...
Installing nginx configuration...
Installing nginx directory...
Updating PHP configuration...
Restarting php...
Restarting dnsmasq...
Restarting nginx...
Valet installed successfully!
由于我使用
brew install yarn
安装报错
解决办法: 1.安装xcode-select
xcode-select --install
2.弹出提示框点击安装
3.重新安装yarn
当然,应该也可以直接
brew install yarn
brew install gcc
brew install yarn
很多时候,brew install xxx的时候巨慢,哪怕你全局梯子也慢,这个时候我们可以考虑手动安装包
$ brew install elasticsearch@5.6
Updating Homebrew...
==> Downloading https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.8.tar.gz
######################################################################## 100.0%
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
######## 12.1%
这里你需要手动把
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.8.tar.gz
下载下来
$ brew --cache
/Users/ailuoy/Library/Caches/Homebrew
把之前的包放到缓存目录下,这个时候你再 brew install xxx,如果还要下载,那一定是文件名称不对
elasticsearch@5.6-5.6.8.tar.gz.incomplete
elasticsearch-5.6.8.tar.gz
这个时候我们只需要把文件名称改成
elasticsearch@5.6-5.6.8.tar.gz
就OK
brew install xxxx
/usr/local/etc
1.5.0
之后新tag由于在
1.5.0
之后取消了很多包,导致很多扩展不能搜索,只能源码编译
# 加入php源
brew tap kyslik/php
brew tap kabel/php-ext
brew search php-imap
brew install kabel/php-ext/php-imap
pecl install imagick
pecl install redis
pecl install xdebug
brew options php71
brew install php71 --with-httpd