L
L
Loligan2017-01-08 21:03:56
PHP
Loligan, 2017-01-08 21:03:56

How to send a keystroke to an executing script run via php via php?

The point is this. I run a console application and it runs until the Q key or ctrl+C is pressed. I use the shell_exec function to run the script. I need at some point to make it so that I would send a keystroke q or ctrl + c to the running process.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
entermix, 2017-01-08
@entermix

End script? Get process PID at startup and kill

T
ThunderCat, 2017-01-08
@ThunderCat

shell_exec("kill -9 $pid");
How to get pid:
stackoverflow.com/questions/1470910/invoke-externa...
stackoverflow.com/questions/7829005/php-get-the-li...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question