All the website developer (who works on Magento) know how to install the magento extension. We use magento downloader to install extension. But sometimes we receive the an error “ERROR: failed to mkdir”. Generally you get the problem after moving the site from one host to another host.
I just found the solution for it. It is because of php.ini file which locates under root/downloader/pearlib/
Simple solution is delete or rename php.ini file (renaming is good option).
Once you will done, try again to install extension and I am sure you will say WOW, it works.