note 69847 added to function.proc-open

From: Date: Fri, 22 Sep 2006 22:37:24 +0000
Subject: note 69847 added to function.proc-open
Groups: php.notes 
Request: Send a blank email to php-notes+get-117458@lists.php.net to get a copy of this message
I wanted to proc_open bash and then send a command and read the output multiple times instead of opening bash each time. There were several "tricks" Put a "\n" on the end of each command Use a fflush($pipes[0]) after each fwrite($pipes[0]) Put a sleep(1) before you read the output of the command Once I added all of that I was able to send an arbitrary amount of commands to bash, read the output and when I was finished I could close the pipes. ---- Server IP: 66.163.161.117 Probable Submitter: 74.133.142.85 ---- Manual Page -- http://www.php.net/manual/en/function.proc-open.php Edit -- https://master.php.net/note/edit/69847 Del: integrated -- https://master.php.net/note/delete/69847/integrated Del: useless -- https://master.php.net/note/delete/69847/useless Del: bad code -- https://master.php.net/note/delete/69847/bad+code Del: spam -- https://master.php.net/note/delete/69847/spam Del: non-english -- https://master.php.net/note/delete/69847/non-english Del: in docs -- https://master.php.net/note/delete/69847/in+docs Del: other reasons-- https://master.php.net/note/delete/69847 Reject -- https://master.php.net/note/reject/69847 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117458) next »