How to install pear modules with MAMP :: MDB2

One of the best tools I use for local development is MAMP (pro) for OSX, recently I needed to add MDB2 to the local install in order to get my local dev environment working completely for a client.

Until today I’ve been getting an error:
Fatal error: Class 'MDB2' not found in ...

Pear needed some additional packages to connect to the DB.

Here’s what you’ll need to do to install pear packages with MAMP on OSX.

Open the terminal and include the full path to pear on the install.

/Applications/MAMP/bin/php5/bin/pear install  [package]

For MDB2 I ran:

/Applications/MAMP/bin/php5/bin/pear install  http://download.pear.php.net/package/MDB2-2.5.0b2.tgz

Then

/Applications/MAMP/bin/php5/bin/pear channel-update pear.php.net

Since I’m using MySQL I had to install the driver.

/Applications/MAMP/bin/php5/bin/pear install http://download.pear.php.net/package/MDB2_Driver_mysql-1.5.0b2.tgz

That’s it. Make sure to download the latest packages from pear.php.net.

About the Author, Dan Cameron:

I'm the owner and solution engineer at Sprout Venture, a web solutions company that specializes in web development including WordPress.

I started my first blog in 2003 and transitioned to WordPress in 2004. Since moving to WordPress I've written a few plugins and themes for public consumption. Lately I'm busy engineering/building/coding and have only been able to share a few code snippets.

If you're in need of some web development, web design or custom WordPress plugins and/or themes contact me, I'll be happy to discuss it with you.

Read More »

  • Thanks, you are a peach!
blog comments powered by Disqus