Wednesday, December 1, 2010

Error in /home/xxxx/public_html/system/library/cache.php on line 27

2 Comments
Error:

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/xxxx/public_html/system/library/cache.php on line 27Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/xxxx/public_html/system/library/cache.php on line 27Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/xxxx/public_html/system/library/cache.php on line 27Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/gudangd/public_html/system/library/cache.php on line 27Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/xxxx/public_html/system/library/cache.php on line 27

Solution:
1. Login to your CPanel Hosting. Go to File Manager. Find this code at public_html/system/cache.php

public function get($key) {
$files = glob(DIR_CACHE . 'cache.' . $key . '.*');

if ($files) {
foreach ($files as $file) {
$handle = fopen($file, 'r');
$cache = fread($handle, filesize($file));

fclose($handle);

return unserialize($cache);
}
}
}

3. Replace with this code:

public function get($key) {
$files = glob(DIR_CACHE . 'cache.' . $key . '.*');

if ($files) {
foreach ($files as $file) {
$cache = file_get_contents($file);
return unserialize($cache);
}
}
}
 

© 2011 Tutorial Opencart - Designed by Mukund | Sitemap

About Us | Contact Us | Write For Us