Answer the question
In order to leave comments, you need to log in
How to run a very heavy PHP script that will not be limited by time and client side?
The problem is that the script takes a very long time to complete. and there is no client interface to use JS (to step by step) because cron or agent is used.
Answer the question
In order to leave comments, you need to log in
If you run the script via cron, then it is executed in cli mode. And in cli mode, php has no limits on the script execution time.
If your script crashes when run from cron, then most likely it exceeds some other limits (most likely, it consumes more memory than allowed).
If memory is a problem, then you can increase the limits, as suggested by @merryjane , or look for and optimize places where you have memory leaks.
UPD: but you, nevertheless, can do a phased execution of the script: generate subtasks with an additional script, put these tasks in some database, and then run your main script several times, and it will already take tasks from such a handicraft queue. Well, or you can use some ready-made queue managers :)
The script time limit is specified in the php settings. No desire to optimize the code? some sort of parser?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question