How to install memcache on MAMP 1.9

I assume you have Apple developer tools (Xcode) installed already because we need GNU Compiler Collection (gcc) (that is integrated to Xcode installation) according to complete the following process. Also I assume you installed MAMP 1.9.x with PHP 5.3.x
Lets follow these steps:

Step 1: Need to Download the PHP source of version same as of your MAMP’s PHP and configure it. For these, open the terminal and run the following commands:

Step 2: Now need to Download the latest stable version of memcache and then configure it. I assume you are in the /Downloads/ directory now on terminal. Then run the following commands:

Step 3: Lets make and install memcache by running the following commands. I assume you are in the /memcache-2.2.6/ directory on terminal.

Step 4: Add this new extension on php.ini file. That file can be found here /Applications/MAMP/conf/php5.3/php.ini
Edit the file by adding the following line

Step 5: Restart the Apache server.