Quick tip, if you have MAMP installed on your machine and need to run PHP or mysql via the terminal/command line, you can execute these lines to create symbolic links to point within your MAMP instance:
sudo mv /usr/bin/php /usr/bin/php-bak sudo ln -s /Applications/MAMP/bin/php/php5.3.14/bin/php /usr/bin/php sudo ln -s /Applications/MAMP/Library/bin/mysql /usr/bin/mysql
Be sure to change the PHP folder to match the version you want by browsing the following path: /Applications/MAMP/bin/php/
The reason for renaming the existing PHP instance is because OSX runs its own web server (if Web Sharing is enabled).