简体   繁体   中英

php script stops in the middle with no errors

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM