PHP script ends earlier, no evidence of error and timeout set to 0

time for another brain teaser of something, I think, is pretty rare.

Is there a hard limit in PHP? Or in Apache? Last night I ran a script that lasted about 20 hours. Then it just stopped, in the middle of the script, on a random line without errors that I could find.

set_time_limit (0); was set in a script, but I'm starting to wonder if there is another limit somewhere else around 20 hours ...

any ideas?

Thank you very much in advance.

edit: this runs as wget.

edit2: I'm going to look at a memory problem and get back to you, thanks for the help so far!

edit3: Oh, I have to point out that this script collects data and stores it in an array, the longer it works, the more it is stored, so yes, I look a little affectionately at "used up all the memory" answers here ...

SOLUTION: the installation of more memory for the operation is fixed. Thanks to everyone.

+6
php
source share
6 answers

Probably php-cli just crashed or your server rebooted. i don't think php will be executed to last

+3
source share

Maybe PHP will run out of memory after some time.

Consider forcing PHP garbage to be compiled at each loop iteration, which might reveal some clues. http://php.net/manual/en/function.gc-collect-cycles.php

+4
source share

I had a script that worked for several months without problems. I just had to kill the process to complete the script. therefore there are no restrictions if you have set_time_limit (0) set; in your code. Have you looked at the system and debug logs of your operating system? which may give further hints why php or apache crashes.

+2
source share

as stated above, check the apache, / var / log / error.log, or in the event windows.

+2
source share

since you used wget, I assume it works under apache. maybe this is apache, which has a restriction on running the script, and not your php application.

you can verify this by running the application from the cli version

0
source share

check php.ini to find the max_execution_time file to make changes for this part, since it takes a few seconds as input.

but be careful when editing php.ini

-one
source share

All Articles