Command Line MAMP
Saturday, June 23rd, 2007I just installed MAMP on my Macbook. This is great, as it gives me MySQL, Apache, and PHP all ready to go. First, I restored default ports in preferences, and then I discovered the beauty of TextMate shortcuts when I typed in vhost[tab] in my httpd.conf file while adding in some of my dev sites. Beautiful. I was ready to go. Now, I just needed to load up some databases. Off to the command line… But, there was no mysqladmin. On top of that, the default php 4 install was in my way when I went to do pear upgrades.
The binaries I wanted were there. They just weren’t in my bash path. Once I found the directories I needed, I just added them to my path by appending the following lines to my ~/.profile…
# Add MAMP binaries to front of path
PATH=/Applications/MAMP/bin/php5/bin:\
/Applications/MAMP/Library/bin:$PATH
export PATH
You’ll notice the existing PATH is appended to the end so that my MAMP php binary is now found before the old php4 version when I type ‘php’ from the command line. I also have access to mysqladmin, mysql, etc. like I would on just about every other machine as well as apachectl so I can do things like config tests and vhosts dumps (apachectl -S).
In my opinion, this should really be a part of the MAMP install. Anyway, I thought I’d document it here for future reference.
The site