2016-06-22 12 views
0

Mac OS 10.11.5(El Capitan)でMAMP設定を使用しています。これは、Webサーバのために正常に動作しますが、私はPHP CLIを使用しようとすると、ターミナルは、システムのバージョン使用しています:私が見つかり、読んだすべてのものからMac OSX El CapitanでPHPのバージョンを変更するには?

$ which php 
/usr/bin/php 

を、解決策はMAMPを追加することであるように思えます私PATHのバージョン:

PATH="$HOME/Applications/MAMP/bin/php/php5.6.10/bin:$PATH" 

しかし、これを追加閉じ、ウィンドウを再開き、ファイルを調達した後、ターミナルはまだ私が欲しいバージョンを見つけることができません。

答えて

2

このhttps://gist.github.com/irazasyed/5987693

Within the Terminal, run vim ~/.bash_profile 

Type i and then paste the following at the top of the file: 

export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH 

Hit ESC, Type :wq, and hit Enter 

In Terminal, run source ~/.bash_profile 

In Terminal, type in which php again and look for the updated string. If everything was successful, It should output the new path to MAMP PHP install. 

In case it doesn't output the correct path, try closing the terminal window (exit fully) and open again, it should apply the changes (Restart in short). 
+0

感謝のための要点があります。私はすでにこれらのステップをすべて実行していますが、バージョンは変わりません。 – ericgio

+1

上記の指示に従えば、MacOS X 10.12 Sierra – ericgio

関連する問題