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

前端 未结 4 1667
太阳男子
太阳男子 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条回答
  •  Happy的楠姐
    2020-12-17 01:12

    If you installed PHP 5.6 using Homebrew, this works:

    Open Terminal, run open -a TextEdit ~/.bash_profile, then paste this in the end of the file:

    # Use Home-brewed PHP 5.6 instead of pre-installed version (5.3)
    export PATH="$(brew --prefix homebrew/php/php56)/bin:$PATH"
    

    Save the file and restart Terminal.

提交回复
热议问题