Mac OSX使用brew安装旧版本phpunit的方法
2017-08-29 22:25
991 查看
brew又称Homebrew,是Mac OSX系统的软件包管理工具,能在Mac中方便安装或卸载软件,类似ubuntu系统的apt-get功能。
常用命令如下:
安装软件
brew install [formula]
卸载软件
brew uninstall [formula]
查看软件
brew search [formula]
升级软件
brew upgrade [formula]
更新brew可支持的软件
brew update
使用brew install安装,会安装最新的版本。
因工作需要,需要安装phpunit,但代码框架不支持最新的phpunit版本,因此需要安装旧版本的phpunit。
1.使用brew安装phpunit
安装完后查看版本
brew install安装的会是最新的版本,而我们需要的是旧版本,因此把此版本卸载。
2.更新brew,检查是否存在可安装的旧版本
更新完后,使用brew search查看可安装的版本
发现还支持5.7版本,这个版本代码框架支持,可以使用。
3.安装旧版本
4.创建快捷方式
安装完成后,因为不是最新的版本,因此不会自动创建快捷方式,我们需要手动去创建。
手动创建快捷方式,使用软链接指向安装的旧版本
使用快捷方式查看版本,可以看到调用旧版本成功
使用brew安装旧版本软件,一定要先卸载当前版本的软件,再重新安装。而如果要升级新版本则直接使用brew upgrade命令即可。
常用命令如下:
安装软件
brew install [formula]
卸载软件
brew uninstall [formula]
查看软件
brew search [formula]
升级软件
brew upgrade [formula]
更新brew可支持的软件
brew update
使用brew install安装,会安装最新的版本。
因工作需要,需要安装phpunit,但代码框架不支持最新的phpunit版本,因此需要安装旧版本的phpunit。
1.使用brew安装phpunit
brew install phpunit
安装完后查看版本
phpunit --version PHPUnit 6.3.0 by Sebastian Bergmann and contributors.
brew install安装的会是最新的版本,而我们需要的是旧版本,因此把此版本卸载。
brew uninstall phpunit
2.更新brew,检查是否存在可安装的旧版本
brew update Already up-to-date.
更新完后,使用brew search查看可安装的版本
brew search phpunit homebrew/php/phpunit homebrew/php/phpunit-skeleton-generator homebrew/php/phpunit@5.7
发现还支持5.7版本,这个版本代码框架支持,可以使用。
3.安装旧版本
brew install phpunit@5.7 ==> Installing phpunit@5.7 from homebrew/php ==> Downloading https://homebrew.bintray.com/bottles-php/phpunit@5.7-5.7.21.sierra.bottle.tar.gz Already downloaded: /Users/fdipzone/Library/Caches/Homebrew/phpunit@5.7-5.7.21.sierra.bottle.tar.gz ==> Pouring phpunit@5.7-5.7.21.sierra.bottle.tar.gz /usr/local/Cellar/phpunit@5.7/5.7.21: 5 files, 2.9MB
4.创建快捷方式
安装完成后,因为不是最新的版本,因此不会自动创建快捷方式,我们需要手动去创建。
phpunit --version -bash: /usr/local/bin/phpunit: No such file or directory
手动创建快捷方式,使用软链接指向安装的旧版本
ln -s /usr/local/Cellar/phpunit\@5.7/5.7.21/bin/phpunitat57 /usr/local/bin/phpunit
使用快捷方式查看版本,可以看到调用旧版本成功
phpunit --version PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
使用brew安装旧版本软件,一定要先卸载当前版本的软件,再重新安装。而如果要升级新版本则直接使用brew upgrade命令即可。
相关文章推荐
- mac下使用brew安装php多版本方法
- 使用 U 盘安装 Mac OSX 系统方法
- pyenv安装与使用-多版本python共存解决方法
- 安装最新版本的PHPUnit后,不能使用
- homebrew在Linux下的使用讨论及Linuxbrew安装方法
- RAID5配置及服务器2003系统安装方法。2000系统的安装要使用7.9版本的引导盘
- 2016 cocoapods的安装和使用方法以及版本升级遇到的问题
- 不使用composer安装yii高级版本的方法
- 安装多个版本JDK后使用时的切换方法总结
- Mac上使用brew安装nvm来支持多版本的Nodejs
- xhprof安装和使用方法(linux版本)
- 在安装有VS2008beta2版本的机子上使用vs2005进行部署出现问题的解决方法
- mac下使用brew 安装mongodb的方法教程
- mac使用brew安装软件失败的通用解决方法
- 版本控制系统Git安装使用方法
- 安装最新版本的PHPUnit后,不能使用
- mac下使用brew 安装mongodb的方法教程
- Windows7(32位)下SVN进行版本控制和项目管理的安装配置和使用方法简述
- 在CentOS系统中使用yum安装指定版本软件的方法
- 版本控制SVN的安装使用方法