Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento CONNECT ERROR: Failed to open file

Tags:

php

magento

I'm having some troubles with installing extensions with magento connect. When I start installing the extension the outline terminal writes something like this:

Checking dependencies of packages Installing package community/OrganicInternet_SimpleConfigurableProducts 0.7.4

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

I checked the path and I found the requested file. As you can see the permissions should be fine ;-)

drwxrwxrwx 2 www-data www-data 4.0K Nov 3 11:10 Configurabl

I have no idea what to do. I'm using PHP 5.5.4-1 - so that should be fine.

Do you have any idea what to do?

like image 784
Daniel K. Avatar asked Nov 03 '13 10:11

Daniel K.


2 Answers

Go

downloader\lib\Mage\Archive\Tar.php

find method

_extractFileHeader().

Then find the near code line no 563:

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

And replace it with:

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

enter image description here

See on dev. comment: enter link description here

like image 173
Ravi Patel Avatar answered Sep 19 '22 20:09

Ravi Patel


The error, in this case, comes from a php security mod that checks files on upload. There seems to be some non-ascii characters in one of the extracted files from the package and as soon as it encounters them it halts processing the file, hence the "Configurabl" is cut short.

What you need to do to get past this error is either adjust the settings of your uploader security mod, but most likely you don't have access to that. The other option is to download the package some other way (in this case it is available on Github at https://github.com/organicinternet/magento-configurable-simple), extract it and upload the files via FTP.

like image 23
Jon Avatar answered Sep 19 '22 20:09

Jon