Mac upgraded PHP to 5.6, but CLI php -v get 5.3.28?

前端 未结 4 1673
太阳男子
太阳男子 2020-12-17 00:26

I have installed MAMP (comes with PHP 5.5) on my machine. And localhost pointed to /Applications/MAMP/htdocs. The problem happened when I was trying to use composer in termi

4条回答
  •  无人及你
    2020-12-17 01:05

    1. Look at the terminal history to see where the new version was installed (probably /usr/local)
    2. Type 'which php' into terminal to see where current version is located (this should be different that new version)
    3. Go to users/username/.bash_profile
    4. Replace the old location with the new location, or add another location after the original location, separated by a colon (if you replace, you may break something else, depending on location).
    5. Restart terminal, run php -v to test.

      export PATH="/usr/local/mysql/bin:/usr/local/bin:/usr/local:$PATH"
      

提交回复
热议问题