I’m using MAMP (Mac Apache Mysql and PHP) and by default it uses an installation of PHP installed in its own directory. However, when executing some php commands like exec() and system(), it uses the command line. I found this out by running exec(“which php”) which displayed /usr/bin/php rather than /Application/MAMP/bin/php. This version of PHP it uses with exec() is a different and older version of PHP than I want. I then upgraded to PHP 5.3 to my /opt/local/bin/ directory. When I run “which php” from the command line, it returns the right php because I have the path /opt/local/bin set up in my bash_profile file. However, when I run this command using exec(“which command”), it returns that it can’t find any PHP in /usr/bin /bin /usr/sbin /sbin. This is most likely because MAMP doesn’t know to look in /opt/local/bin. My question is why and how can I make MAMP include the path /opt/local/bin to find the proper php install.