time for another brain teaser of something I guess is quite rare.
Is there a hard limit in PHP? Or in Apache? I had a script running last night which lasted around 20 hours. Then it just stopped, mid script on a random line with no errors that I could find.
set_time_limit(0); was set in the script but I'm starting to wonder if there is another limit somewhere else for around 20 hours...
any ideas?
Many thanks in advance.
edit: this is run as a wget.
edit2: I am going to look at the memory issue and get back to you, thanks for the help thus far!
edit3: Oh I should point out this script is gathering data and storing it in an array, the longer it is running the more it is storing so yeah, I'm kinda palm facing on the "used up all the memory" answers here...
SOLUTION: Setting a larger memory for the operation fixed this. Thank you everyone.
Perhaps PHP runs out of memory after a while.
Consider forcing PHP garbage collection on every iteration of the loop which may reveal some clues. http://php.net/manual/en/function.gc-collect-cycles.php
problably the php-cli just crashed or your server rebooted. i dont think php is ment to be executed that long
i had a script that ran for several months without a problem. i just had to kill the process to terminate the script. so there's no limit if you have set_time_limit(0); in your code. have you looked at the system and debug logs of your operating system? that may provide further clues why php or apache crashed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With