Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I'm running PHP with MAMP on OSX 10.5.8

So if I want to run a script from console I always need to write

/applications/mamp/bin/php5.3/bin/php path/to/script

which is annoying. Is there a way to change the default path to php so that I can write

php path/to/script

and still uses MAMPs PHP version?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
528 views
Welcome To Ask or Share your Answers For Others

1 Answer

Create a file called .bash_profile on your home directory (if you don't have this file already), and add this to the file:

export PATH=/Applications/mamp/bin/php5.3/bin:$PATH

Then quit and relaunch Terminal.app


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...