installing ffmpeg on MAMP
Question
I'm attempting to follow this tutorial: http://drupal.org/node/1464236 on installing ffmpeg on MAMP (for use with Drupal, which is incidental)
I'm stuck here:
You should also execute in your Terminal
which php pecl phpize
which should point to your MAMP installation:
/Applications/MAMP/bin/php/php5.x.x/bin
...but when I do it, which php pecl phpize
says it's pointing to /usr/bin/php
(and pecl and phpize respectively). If I do ln /usr/bin/php /Applications/MAMP/bin/php/php5.3.6/bin/php
it says 'file already exists'. How do I point to the right file?
Solution
Your $PATH
is wrong, which means that something went wrong in the first step of that tutorial:
First of all point your php and phpize to your MAMP environment
Add/change following line in ~/.profile or ~/.bashrc (for bash):export PATH=/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php/php5.2.17/bin:/usr/local/bin:$PATH:/opt/local/bin
and after that please re-login (or just execute e.g. /bin/bash).
Did you remember to re-login?
Let me also add, doing something like your attempted fix with ln
is generally not a good idea. /usr/bin
generally contains system-installed software and may depend on that software being the correct version in the correct location. If you want to use a different version of PHP for something, the standard practice is to install it somewhere else, like /usr/local/bin
, and then have that directory listed before /usr/bin
in your $PATH
. That way you'll use your version, while the system will still have its version to use.
OTHER TIPS
Try
ls -l /usr/bin
If it shows something like /usr/bin/php -> /Applications/MAMP/bin/php/php5.x.x/bin
in the last column you're all good. Otherwise, you might have to uninstall the non-MAMP php installation.
EDIT: You can also put the MAMP php path before /usr/bin in your $PATH. The first step in the linked tutorial tells you how to do that.