I have a folder with documents that needs to be processed by a php script. Say there are 1000 documents in the folder, each will be deleted after processing.
How can I run or rerun a php script from the browser without hitting the server max_execution_time without manipulating the max_execution_time itself and without using cronjobs?
I thought about some solutions:
-having 2 php scripts that run the same while loop and stop itself after 25 seconds and activate the other script to take over the job. And this back and forward until the folder is empty.
-Using ajax/javascript to stop executing the script and reactivate it again.
Are there better solutions?
I use the ajax/javascript successfully. You can keep the number of items processed in $_SESSION. I run batch that can work for more than one hour with no problem.