PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
but i need to be able to access an already existing terminal. i have no idea how to do that.
for example:
lets say i have ./example running when i type in ps -eaf
how do i make it so i can "open" ./example so i can see all it returns?
if i want to go into ./example and run the command "status", i know i would use shell_exec() or something, but the program doesnt know which terminal to use the command "status" in.
this might seems confusing, but the way i imagine it is that then u use shell_exec() it activates its own new shell instead of an existing one.
Hmm, not sure that would be possible. If you have control over this shell script would it be possible for you to alter it, so that when you type 'status' it outputs and also outputs to a file, maybe status.txt, and have PHP parse this file rather than try to access the shell directly?
You can try to start the program using the screen command. Then you can use [php_man]proc_open[/php_man] to connect a pipe to the program under the screen's control.