M
M
MrJobs2021-06-04 07:51:42
PHP
MrJobs, 2021-06-04 07:51:42

How to run PHP script background process?

Hi all. The question may seem lame, I have never worked with the terminal before. It is necessary to start the execution of a php script (with an
infinite loop) in the background using the console
.
.php &
in jobs [1]+ Running nohup php filename.php &

No calls to the script.
It’s not difficult for anyone, chew what I’m doing wrong

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2021-06-04
@saboteur_kiev

you are trying to run the script itself, but php is not an executable file, so Linux doesn't know what to do with it. Run the php interpreter itself (php filename.php)
i.e. the full command:
nohup php filename.php &

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question