V
V
Vladimir Revyakin2017-02-09 12:01:34
PHP
Vladimir Revyakin, 2017-02-09 12:01:34

Running a script via cron?

Good day, please tell me if I run a php script via cron, the script is long, lasts 3-7 minutes (Sending letters to the database), so the limitation stated in nginx and php-fpm will not work through cron, before that I ran it by link to the script and it gave 504 time out ?
And do it through cron through curl and then a link to the script?
Or is it possible to do this without a cron before the link so that there would not be a 504 timeout?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2017-02-09
@jonimuesli

You don't really need a web part. Run the script via cron as a local command:/usr/bin/php script.php

V
victorburre, 2017-02-09
@victorburre

When running from cron on a direct path to the script, there will be no timeout.
Also use set_time_limit() in a script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question