Going to timeout while creating thumbnails

See all posts Reply

Going to timeout while creating thumbnails new!
by Sumit, 9 years, 11 months ago
Hi,

I used class.uplad.php in my script. Everything is working perfectly. Butr after a while it is going to timeout. I am handling almost 10000 thumbnails.

And the server where i am running this code, is a shared server. Some important php.ini values are as follows :
memory_limit = 128 MB , max_execution_time = 300, max_input_time = 600, max_file_uploads = 20.

Here is my code below
$foo = new Upload($img_dir . ORIGINAL_IMAGE_PATH ."/". $prod['image_folder'] . $prod['products_image']);
if ($foo->uploaded) {
	$foo->image_resize          = true;
	$foo->image_y               = SMALL_IMAGE_HEIGHT;
	$foo->image_x               = SMALL_IMAGE_WIDTH;
	$foo->Process($dir_dest_small);

	$foo->image_resize          = true;
	$foo->image_y               = PRODUCT_IMAGE_HEIGHT;
	$foo->image_x               = PRODUCT_IMAGE_WIDTH;
	$foo->Process($dir_dest_display);
	
	$foo->image_resize          = true;
	$foo->image_y               = LARGE_IMAGE_HEIGHT;
	$foo->image_x               = LARGE_IMAGE_WIDTH;
	$foo->Process($dir_dest_large);
	
	$foo->image_resize          = true;
	$foo->image_y               = OPI_IMAGES_MINHEIGHT;
	$foo->image_x               = OPI_IMAGES_MINWIDTH;
	$foo->Process($dir_dest_adminthumb);
	
	$foo->image_resize          = true;
	$foo->image_y               = SMALL_IMAGE_HEIGHT;
	$foo->image_x               = SMALL_IMAGE_WIDTH;
	$foo->Process($dir_dest_adminpreview);
	
	unset($foo);
}

Is anything wrong in my code ? Please suggest.

Thank you in advance.Reply
Re: Going to timeout while creating thumbnails new!
by colin, 9 years, 11 months ago
I suppose you run out of memory (or even time for the script). Please check your server's logs.Reply