今天在安裝單元測試框架PHPUnit,需要PHP的最低版本是5.6,由於我的MacBook自帶的PHP版本是5.5.36,不能滿足安裝條件。
看了一下這個網址:https://php-osx.liip.ch/#install ,但是下載不了,里面的一句話引起了我的注意:
You can also adjust your PATH do include that directory, eg. write into your ~/.profile file the following
export PATH=/usr/local/php5/bin:$PATH
這句英語的意思是要求你去修改PATH環境變量
於是我就在~/目錄下新建了.profile文件,然后把我安裝的mamp帶的php路徑加進去,
export PATH=/Applications/MAMP/bin/php/php5.6.10/bin:$PATH
然后命令source .profile ,用php -v顯示當前環境的PHP版本,發現已經變化了