MrConstantine Posted January 19, 2014 Share Posted January 19, 2014 i have this msg when someone join on my website?? what t do??i change permission to this file,but i have the same msg too Link to comment Share on other sites More sharing options...
prestashopninja Posted January 19, 2014 Share Posted January 19, 2014 If you want, you can take a copy of the file and then delete it. PS will regenerate it and the problem should be solved. Link to comment Share on other sites More sharing options...
haunter Posted January 20, 2014 Share Posted January 20, 2014 (edited) I get this error in Performance tab only... when I deleted it, everything stop working (frontend too) and show this error, so i uploaded it again and same error, only in Performance tab again :-D SOLVED: 777 permissions recursively on all cache directory Edited January 20, 2014 by haunter (see edit history) Link to comment Share on other sites More sharing options...
BigfootSRL Posted February 14, 2014 Share Posted February 14, 2014 I have the same issue, but when i try to delete the file or update the attribute to 666 the system reset it to 664 some second later /cache/class_index.php is not writable, please give write permissions (chmod 666) on this file The error is really annoing when you need to update a great amount of item Link to comment Share on other sites More sharing options...
BigfootSRL Posted February 14, 2014 Share Posted February 14, 2014 From the log of my host i find a lot of line like this [Fri Feb 14 16:31:54 2014] [error] [client 66.249.64.3:37224] - www.big-foot.it - AH01215: [Fri Feb 14 16:31:54 2014] [warn-phpd] mmap cache can't open /web/htdocs/www.big-foot.it/home/cache/class_index.php - Stale file handle (pid 6562), referer http://www.big-foot.it/it/tattici/3-mav1.html Link to comment Share on other sites More sharing options...
prestashopninja Posted February 14, 2014 Share Posted February 14, 2014 Hi, You need to inform your hosting provider about the issue. Link to comment Share on other sites More sharing options...
BigfootSRL Posted February 14, 2014 Share Posted February 14, 2014 Is something they can fix ?? What about the regeneration of the class_index.php? It is also a Hosting issue? Link to comment Share on other sites More sharing options...
prestashopninja Posted February 14, 2014 Share Posted February 14, 2014 (edited) This is something only they can fix unless you have another code changing the permissions tied to cron or triggered in another manner. If Prestashop cannot write to class_index.php file because the system resets permissions, it cannot regenate it either. Edited February 14, 2014 by prestashopninja (see edit history) Link to comment Share on other sites More sharing options...
BigfootSRL Posted February 14, 2014 Share Posted February 14, 2014 Thanks a lot for your help. I was looking trough several post from weeks without any practical solution. I keep you updated on this issue. Link to comment Share on other sites More sharing options...
BigfootSRL Posted February 17, 2014 Share Posted February 17, 2014 My hosting seems to go in the wrong direction to resolve my issue. They say all the files that use php need to be set il CHMOD 755. I have made some test and seems to be some istruction in the prestashop code that reset the CHMOD of the file to 664 when you open a page on the site. Do you know if there is some istruction (and where it is) that rewrite the class_index.php in cache folder? Link to comment Share on other sites More sharing options...
prestashopninja Posted February 17, 2014 Share Posted February 17, 2014 (edited) The file is created in Autoload::generateIndex() method. (classes/Autoload.php) and it seems that it tries to set the perms to 666 there. Please give it a try with 755. Normally you should use an override, but in a case where you deal with the very file determining which classes are overriden, it's better to work on Autoload.php file directly. Anyway, please do not forget to take a backup first. Edited February 17, 2014 by prestashopninja (see edit history) Link to comment Share on other sites More sharing options...
BigfootSRL Posted February 17, 2014 Share Posted February 17, 2014 Ok, i have found the function where the CHMOD is setted and in this function have found @chmod($filename, 0664); I have put it in 666 and now the file class_index.php is created in 666 (and apparently the site is working good) My question now is: if this file need to be in 666 why the code create it in 664?? I try to put under stress the site to see if the error is still shown. I'll keep you updated Here the modified function public function generateIndex() { $classes = array_merge( $this->getClassesFromDir('classes/'), $this->getClassesFromDir('override/classes/'), $this->getClassesFromDir('controllers/'), $this->getClassesFromDir('override/controllers/') ); ksort($classes); $content = '<?php return '.var_export($classes, true).'; ?>'; // Write classes index on disc to cache it $filename = $this->root_dir.Autoload::INDEX_FILE; if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename))) { header('HTTP/1.1 503 temporarily overloaded'); // Cannot use PrestaShopException in this context die('/cache/class_index.php is not writable, please give write permissions (chmod 666) on this file.'); } else { $filename_tmp = tempnam(dirname($filename), basename($filename.'.')); if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE) { rename($filename_tmp, $filename); @chmod($filename, 0666); } else { // $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), // no need to die. error_log('Cannot write temporary file '.$filename_tmp); } } $this->index = $classes; } Link to comment Share on other sites More sharing options...
prestashopninja Posted February 17, 2014 Share Posted February 17, 2014 In my Prestashop version (1.5.6.2) it is already 666. Link to comment Share on other sites More sharing options...
BigfootSRL Posted February 17, 2014 Share Posted February 17, 2014 At the moment i am at the 1.5.6.1 I am waiting the 1.6 to be released to update all the site. If the error doesn't correct with this modify i update at the latest release to see if it resolve. Thanks for your help and your time Link to comment Share on other sites More sharing options...
Recommended Posts