0

I got script that iterate all images in directory and resize them.
I got directory with 2000 images which takes some time.

I ran the script and saw that it resized only 40-50 images, then I ran it again, it resized ANOTHER 40-50 images and so on...

Do you have any idea why this is happening and how to allow the script run until it really done?

4
  • 2
    What is your time limit set to in your php settings? Commented Apr 3, 2013 at 14:57
  • php.net/manual/en/function.set-time-limit.php Commented Apr 3, 2013 at 14:57
  • max_execution_time = 30, Timeouts Connection: 300 - Keep-Alive: 15 Commented Apr 3, 2013 at 14:59
  • Did it run about 30 seconds then stop? Commented Apr 3, 2013 at 15:01

2 Answers 2

1

It's just a matter a maximum execution time limit

if you are running a script that needs to execute for unknown time, or forever.. you may use

set_time_limit(0);

Doc: http://php.net/manual/en/function.set-time-limit.php

Sign up to request clarification or add additional context in comments.

Comments

1

On that page of code add: set_time_limit(0); should run until it is done.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.