Is there a way to make the file streams returned by proc_open() persistent between page loads so I can make a PHP style interface to a terminal program?
Looking over the php functions it seems possible to make persistent pointers with stream_socket_client(<URL>, STREAM_CLIENT_PERSISTENT). But I don't think its possible to make a pointer to a terminal using a URL schema.
The other thing I can think of is to make a small C program to pipe output from stdin to a network socket and have PHP communicate with that.
I did some kind of testing, but my PHP didn't have PTY support compiled in so I gave up. I do think this would allow it to work, however.
Name:
Anonymous2006-04-08 4:07
>>2
I tried using dtach with proc_open() and passthru(). I can't use pty because I'm on Debian with php4 and you need php5 to use pty. Using pipes I get dtach errors like:
dtach: tcgetattr: Inappropriate ioctl for device
Name:
Anonymous2006-04-08 4:54
>>3
Yeah, it requires a "real" terminal. I think a PTY would do it, but I am not entirely sure... and that reminds me! I just remembered the great idea I had last night but didn't write down, thanks!