Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

PHP: proc_open persistent file pointers

Name: Anonymous 2006-04-07 16:32

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.

Name: Anonymous 2006-04-07 16:56

http://dtach.sourceforge.net/

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: Anonymous 2006-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: Anonymous 2006-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!

Name: Anonymous 2010-09-21 13:19

PHP makes me want to /wrist

Name: Anonymous 2011-03-19 20:53

This is a demonstration for rentacoder5 in an old thread (repetition 0).

Name: Anonymous 2011-03-19 20:54

This is a demonstration for rentacoder5 in an old thread (repetition 1).

Name: Anonymous 2011-03-19 20:54

This is a demonstration for rentacoder5 in an old thread (repetition 2).

Name: Anonymous 2011-03-19 20:55

This is a demonstration for rentacoder5 in an old thread (repetition 3).

Name: Anonymous 2011-03-19 20:55

This is a demonstration for rentacoder5 in an old thread (repetition 4).

Name: Anonymous 2011-03-19 20:56

This is a demonstration for rentacoder5 in an old thread (repetition 5).

Name: Anonymous 2011-09-18 3:55

[spoiler]boo[spoiler]

Name: Anonymous 2011-09-18 3:56

[b]derp[/b]

Name: Anonymous 2012-03-28 2:19

my farts burn my anus
it hurts
in a good way

Don't change these.
Name: Email:
Entire Thread Thread List