On May 14, 2009, at 6:07 AM, sohdubom wrote:
Hi. yes my path is: PhpMate r11069 running PHP 5.2.6 (cli) (/usr/bin/php)
If I check the path running PhpInfo() through MAMP I get: Configuration File (php.ini) Path : /Applications/MAMP/conf/php5
So I need do configure .bashrc or .profile and add a PATH to: /Applications/MAMP/conf/php5 ?
Yes, you do. I believe it is .bash_profile now, after reading some. Though .profile seems supported, probably for compatibility reasons.
In the Terminal when I : echo $PATH I get: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin Where is this $PATH set, since I'm not using a .bashrc file in my user home dir
The default $PATH is set from /etc/profile, which runs around and gets values from /etc/bashrc.
You *do not* want to edit those files.
Can I use the .profile file? How could I configure the right path in this case?
I have never been entirely clear on why you would chose .bash_profile over .bashrc in ~
A doc I found states: To make these changes permanent, add the commands described above to the end of your .cshrc file (for csh and tcsh), .profile file (for sh and ksh), or .bash_profile file (for bash).
Probably .profile works since Apple used to use tcsh a long time ago, and they wanted to maintain a working set of shell prefs for upgrade users.
That implies you should set them in .bash_profile
I have always set them in .bashrc, but I also know they work in .bash_profile. I use both, I actually use .bashrc and then source the .bash_profile.
Remember the earlier entries in the path take precedence over the later ones. If you want the directories you add to your path to take precedence, add them first in the list of colon separated values.
I would do this: pico -w ~/.bash_profile
You will add data to this file, if you add other data, make sure the $PATH is set last in the file, at the bottom.
export PATH=/Applications/MAMP/conf:$PATH
Save the file, control-x then press y, then enter, either close the terminal, open again, or type `source ~/.bash_profile`
Type `echo $PATH` and make sure your new path has /Applications/MAMP/ conf at the front of it. Test again with `which php` and I believe you should see your new location to php being found. TM should now be happy as well.
Please feel free to let me know if this does not work for you. I installed MacPorts php and even added a variant for IMAP, changing my path allowed TM to run the IMAP commands. I wish Apple would just supply a better php, as Apache is fine, but php is far too bare bones to do any serious work.