Howto: Resolve “Failed to Open File” error when installing Magneto Connect extensions

If you’re trying to install a Magento extension though Magento Connect and getting an error like the following:

CONNECT ERROR: Failed to open file /var/www/magento/downloader/.cache/community/OrganicInternet_SimpleConfigurableProducts-0.7.4/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Configurabl

It’s caused by a simple (yet long-lived and un-fixed) bug in Magento’s downloader.




if (!($header['name'] == '././@LongLink' && $header['type'] == 'L')) {
     $header['name'] = trim($header['name']);
     return $header;

Replace with:

if (!(trim($header['name']) == '././@LongLink' && $header['type'] == 'L')) {
     $header['name'] = trim($header['name']);
     return $header;

Then try to install your extension again. Always remember to disable the compiler before hand, clear caches, and log out of the admin after installing an extension.

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>