M
M
mihalich40402017-07-07 12:29:42
linux
mihalich4040, 2017-07-07 12:29:42

How to get a list of running php scripts?

Some php scripts that update information are constantly running, but sometimes they freeze or, even worse, when the page is refreshed, they launch a parallel version. Are there any built-in php tools to view running and currently running php pages, not just process information.
Unfortunately, I didn’t find anything and I was already going to write my own solution, where the script writes every minute to the file, just the time and at startup they will check the time the file was last modified to understand whether it is running or not. But for sure there is a beautiful solution built into PHP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-07-07
@BorisKorobkov

cron:

flock -w 3 /tmp/my_script.pid php /var/www/my_script.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question