Hello,

I need to encode some text using GPG in a PHP program. I've a class wich
uses popen like this:

//--- start ---

// parameters to gpg omited...

$command = "echo '$text' | gpg <snip>";

$fd = popen("$command","r")
if (!$fd) {
   return -2;
}

$enc = "";

while (!feof($fd)) {
   $enc .= fgets($fd,4096);
}

pclose($fd);

//--- end ---

That's with PHP4. It works ok in non-safe-mode, but with safe-mode turned
on it doesn't. I'd like to use safe mode. Does anyone know a better (or
correct) way to open this kind of pipe under safe_mode? (I've read a
comment in the manual telling about opening the pipe for read-write mode,
but it seems not to work wit the echo stuff in the first part of the
command).

Thank you.
Rodolfo.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to