Hello

I'm trying to run gpg from my php script using exec and I keep getting error 2 all the time. If I just run gpg --help for test purposes, it runs fine without errors. Here's what I'm doing

putenv("GNUPGHOME=/usr/home/myhome/.gnupg");
$oldhome = getEnv("HOME");
putenv("HOME=/usr/home/myhome");
$command = "'Hello' | /usr/local/bin/gpg -a -u 'secret' --recipient 'public' --no-secmem-warning --encrypt";// it's just a test so it mightn's really make sense, i get the same error if i try to encrypt a file without using pipes
exec($command, $res, $err);
putenv("HOME=$oldhome");

$err echoes as 2

Does anybody have any suggestions?

Thank you