D
D
Dmitry2017-01-07 21:56:11
linux
Dmitry, 2017-01-07 21:56:11

How not to wait for the response of a console command when running it from php?

Good afternoon
, an ajax request is sent from the page, a command is launched from php on the server side, let it be ping
exec('ping 1.1.1.1 -c 100 >buffer &');
The plan is to read the command output file line by line using ajax and give it to the user. But despite the fact that at the end of the command is '&'. all the same, php waits for the command to complete and 'freezes' for that time. How to win it? I'm not a big expert in linux

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2017-01-07
@Sad_Bro

stackoverflow.com/questions/45953/php-execute-a-ba...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question