Z
Z
zzmaster2018-10-20 20:44:29
PHP
zzmaster, 2018-10-20 20:44:29

The php process hangs from the command line, what should I do?

I once noticed such a situation that a cron task, a php script that has

set_time_limit(60)

hangs for more than a day and does not work at the same time (it must pick up and process files)
Are there any ways to prevent this or somehow such a process is automatically destroyed, since its presence in the list of processes prevents the same process from starting the next minute (such parallel execution overlay avoidance system).
This happens on Centos 6.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Skobkin, 2018-10-20
@skobkin

You can try running it with a debugger (xdebug) or a profiler and see what it sticks to.
You can hook up to it from the outside, for example, strace and see what system calls it makes.

R
rPman, 2018-10-20
@rPman

in the cron task, save the pid of the process to a file (run it with & and immediately take the pid from the $ variable!), and accordingly, before that, kill the process with pid from this file (if it exists).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question