D
D
Denis99992020-11-30 13:57:57
PHP
Denis9999, 2020-11-30 13:57:57

Does a lengthy php script run via cron break?

In php script put:

set_time_limit(0);
ini_set('max_execution_time', '-1');


In php.ini set max_execution_time= '-1' , phpinfo() shows that max_execution_time is -1 . But the script is still interrupted, there are no critical errors in the logs.

Have I done everything in terms of settings so that the php script is not interrupted?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-11-30
@Denis9999

https://www.php.net/manual/en/info.configuration.p...

max_execution_time int
This directive specifies the maximum time in seconds during which the script must be fully loaded. If this does not happen, the parser exits the script. This mechanism helps prevent the server from freezing due to poorly written script. The default is 30 seconds to load. If PHP is run from the command line, this value is 0 by default.

The problem is not the execution time limit. Post logs for each step.
there are no critical errors in the logs.

And in what logs? Did you install a custom log file? Or look in the apache log files?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question