newbie question "Public key not found" with PHP

Tom Beidler
Tue, 12 Dec 2000 13:30:21 -0800

Please CC me. I'm not sure if I'm subscribed yet.

I'm having problems using GNUPG for the first time. I'm using it with PHP
and I'll show you my code;

 // Set directory for "www"'s key ring
 // Dump email message into indata file
 $fp = fopen("/usr/home/dogma/temp/indata", "w+");
 fputs($fp, $msg);
 // encrypt
 system("/usr/local/bin/gpg --encrypt -ao /usr/home/dogma/temp/outdata -r
 'Joe Schmoe <>' /usr/home/dogma/temp/indata ");
 $crypted = "/usr/home/dogma/temp/outdata";
 $fd = fopen($crypted, "r");
 $mail_cont = fread($fd, filesize($crypted));

I keep getting "Public key not found". The key lines are the "putenv" which
is the directory of the PHP users key ring and "system" which is the actual
command line. I've tried several variations of the public key, ie. 'Joe',
'Joe Schmoe', ''.

I've tried telneting in as myself and encrypting something and I get the
samething. When I --check-ring it shows that I have both my private and
public key.

Any help would be appreciated.


Tom Beidler Orbit Tech Services 805.455.7119 (cell) 805.682.8972 (phone) 805.682.5833 (fax)
-- Archive is at - Unsubscribe by sending mail with a subject of "unsubscribe" to