Suppressing gpg messages from php exec command?

Hack Hawk hh@hackhawk.net
Tue Apr 8 05:18:02 2003


Hello,

I'm pulling my hair out over this one, can anyone assist?  I've searched 
google for hours but to no avail.  I'm trying to suppress gpg output from 
within a php script.

Here's the important stuff.

--------- PHP -----------------
$msg = $some_gpg_signed_clear_text
$comd = "echo '$msg' | /usr/local/bin/gpg --decrypt";
exec($comd,$res,$errcd);
------- END PHP ---------------

I get the unsigned text in $res without a problem.  The problem is that the 
following output is sent to the terminal/browser/whatever.

--------------------------------
gpg: Signature made Thu 03 Apr 2003 06:24:21 PM PST using DSA key ID AABBCCDD
gpg: Good signature from "Blah Blah <blah@blah.com>"
gpg:                 aka "Blah Bleh <blah@blah.org>"
--------------------------------

I've tried adding ALL of the following to the $comd command line with no 
success.

--logger-fd 1
--status-fd 1
--quiet
--batch
--no-tty
2>&1

Is there ANYWAY to suppress these messages?  I'm assuming that if the 
signature is NOT validated, then the $res will NOT return the unsigned 
message, and that's how I'll verify validity or not.  Please correct me if 
I'm wrong about this assumption.

Thanks in advance for any replies
- Rich