Patrick Ward words, code, and music

Adding Net_GeoIP to MAMP

I had to add Net_GeoIP to my MAMP setup, but ran into a little problem with the basic setup on my computer.

I tried running the pear install using MAMP’s version of pear:

/Applications/MAMP/bin/php/php5.3.14/bin/pear install Net_GeoIP

But, it kept telling me I’d already installed it. I had, but under the Mac system setup, not within MAMP.

I couldn’t figure out why it was seeing the Mac setup from within MAP. Until I realized that pear was reading from my local user config located at ~/.pearrc.

So, I simply told the MAMP version of pear to find the local user config file where the MAMP config file resided:

/Applications/MAMP/bin/php/php5.3.14/bin/pear -c /Applications/MAMP/bin/php/php5.3.14/conf/pear.conf install Net_GeoIP

And, Voila! Net_GeoIP installed within the MAMP setup.