Dear Developer,
I'm getting the following error message in image.php(Only it is last 2 days).
I'm using zenphoto version 1.2.4 [3716] (
http://gallery.southdreamz.com/movie-gallery/yogi/yogi-movie-working-stills-02.jpg.html).
Warning: fopen(cache_html/images/movie-gallery_yogi-yogi-movie-working-stills-24.jpg_en_US.html) [function.fopen]: failed to open stream: File too large in /xxx/gallery.southdreamz.com/zp-core/plugins/static_html_cache.php on line 171
Warning: fputs(): supplied argument is not a valid stream resource in /xxx/gallery.southdreamz.com/zp-core/plugins/static_html_cache.php on line 172
Warning: fclose(): supplied argument is not a valid stream resource in /xxx/gallery.southdreamz.com/zp-core/plugins/static_html_cache.php on line 173
--
thanks & regards,
palPalani
Comments
After emptying the static cashe folder you may be able to enable the static cache plugin again. I don't know.
If not deleted automattically, then please help me, how to delete all expired files automatically.
Check also the permissions on the cache folder.
I have one question, how the expired files are deleted, using CRON jobs?
For this issue, i have created small PH script, and i i'm going to setup cron job using my panel. before going to live i want check with you.
Note: it is not using any zenphoto function and deleting only images, albums.
`
<?php
/*
Cleanup a ZenPhoto cache_html directory, deleting any files older then set amount of hours.
@dir- The directory to cleanup
@ret_hr- Files older then this will be deleted
*/
set_time_limit(30);
cleanup_dir("cache_html/images/", 24);
cleanup_dir("cache_html/albums/", 24);
function cleanup_dir($dir,$ret_hr) {
$del_date = time()-($ret_hr * 60 * 60);
if (is_readable($dir) && $handle = opendir($dir)) {
clearstatcache();
while (false !== ($file = readdir($handle))) {
$t = filemtime( $dir.$file );
echo ''. $dir.$file .' :: '. $t .'='. $del_date;
if ($file != "." && $file != ".." & $t < $del_date) {
//@unlink($dir.$file);
echo '-- FOUND';
}
}
closedir($handle);
}
}
?>
--
Update:
actual delete function is commented here.