I am trying to encrypt users' responses to a form using PGP. The relevant portion of my code is:
exec("echo $message | pgp -fea Andre Amiri aamiri@ucla.edu", $output, $code);
This line generates an error code of 255 (=failure) when the page is served up by Apache. However, when I run my script from the the PHP interpreter on the command line (i.e. c:\php\php.exe myscript.php), it works just fine.
Any ideas as to why I'm getting these varying results using exec()? FYI, a simpler command such as
exec("dir", $output, $code);
works fine both ways.
Thanks