V
V
Vladimir Revyakin2017-07-08 12:45:43
PHP
Vladimir Revyakin, 2017-07-08 12:45:43

Running a PHP script in the background?

Good day, please tell me how to be, the programmer asks to constantly run the PHP script on which he raises the socket, to run in the background I do it through nohup php files/sockets/sockets.php &, but after an indefinite time the script may fall, are there any then more reliable ways to run php script in background?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Skobkin, 2017-07-09
@jonimuesli

supervisord , systemd.

A
artem78, 2017-07-08
@artem78

PHP is not the best language for daemons. Use python for example.

B
Boris Korobkov, 2017-07-08
@BorisKorobkov

Run not php directly, but sh-file like

while true
do
   php files/sockets/sockets.php
done

Well, for reliability, add verification and launch to cron.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question