homebrew
/bin/bash -c "$( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) "
替换homebrew国内镜像源
brew install --cask dosbox
git -C "$( brew --repo) " remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
git -C "$( brew --repo homebrew/core) " remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$( brew --repo homebrew/cask) " remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
git -C "$( brew --repo homebrew/cask-fonts) " remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
git -C "$( brew --repo homebrew/cask-drivers) " remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
git -C "$( brew --repo homebrew/cask-versions) " remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-versions.git
git -C "$( brew --repo) " remote set-url origin https://github.com/Homebrew/brew.git
BREW_TAPS = "$( brew tap) "
for tap in core cask{ ,-fonts,-drivers,-versions} ; do
if echo "$BREW_TAPS " | grep -qE "^homebrew/${tap} \$" ; then
git -C "$( brew --repo homebrew/${ tap} ) " remote set-url origin https://github.com/Homebrew/homebrew-${tap} .git
fi
done
安装php
brew search php
brew install php@7.2
pecl search redis
pecl install redis
pecl install swoole
pecl install http://pecl.php.net/get/swoole-4.6.1.tgz
brew install brew-php-switcher
brew install php@7.3
brew-php-switcher 7.3
brew services start php@7.2
brew services restart php@7.2
brew services stop php@7.2
编译安装php扩展
git clone https://github.com/zzjin/php-ext-trie-filter
cd php-ext-trie-filter/
/usr/local/bin/phpize
# 如果php-config在$PATH下,可不用加--with-php-config,不在则指定
./configure --with-php-config=/usr/local/bin/php-config
make
make install
# 添加扩展到php.ini
php -i|grep ini # 找到对应的php.ini地址 添加
vim php.ini
extension=trie_filter.so