I'm the only administrator of the database. I want to run a one time script that basically takes around 3800 scanned images (it will grow up to 10 000 thousand) and create a couple of thumbnails for each image using the PHP exec() function to execute the external program imagemagick to create those thumbnails.
I've created the script, launched it and all works perfectly! All is done on my local development server. The script takes around 11 minutes to create thousands of thumbnails. It's a one time operation that is run every other year, so the consequences are minimal.
So far so good. Here's when i running into problems.
Everything that i did on my local development server I did on the live server for testing purposes. I have a shared host account with hostgator. Running my 11 minutes long script on a shared host gives me the error 'Maximum execution time of 30 seconds exceeded...'. I did my research, tried many of the solutions found in this post (Increase max execution time for php) just to realize there is nothing i can do to change the maximum execution time of a script on a shared host.
I'm stuck. So, my question is what is the obvious solution here.
I was thinking of launching the script for every 200 images, refresh the page automatically and run the script again for the next 200 images and so on until there's no more images. This way i'm sure the 30 seconds maximum execution time allowed on my shared host is respected. It looks like a solution right off the top of my head, but i'm not sure if this is a NO NO, if i'm going to run into bigger problems, too many negatives..
Is this the obvious solution? Anyone run into the same problem? What did you guys suggest?
Thanks