diffnest / myblog

0 stars 0 forks source link

mac PHP多版本切换 #24

Open diffnest opened 6 years ago

diffnest commented 6 years ago
  1. brew install 5.4.45 brew install 5.6.33

  2. 报错:

    Error: Cannot install homebrew/php/php70 because    conflicting formulae are installed.
    php54: because different php versions install the same  binaries.
    Please `brew unlink php54` before continuing.
    

    解决方法:brew unlink php54

3.安装切换工具php-version

jiayuandeMacBook-Pro:wangdengke brew install php-version
jiayuandeMacBook-Pro:wangdengke source $(brew --prefix php-version)/php-version.sh 

jiayuandeMacBook-Pro:wangdengke jiayuan$ php-version
5.4.45
* 5.6.33

jiayuandeMacBook-Pro:wangdengke jiayuan$ php-version    5.4.45

jiayuandeMacBook-Pro:wangdengke jiayuan$ php -v
PHP 5.4.45 (cli) (built: Mar 13 2018 13:06:54) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend    Technologies

jiayuandeMacBook-Pro:wangdengke echo "source $(brew --prefix php-version)/php-version.sh" >> ~/.bash_profile