Invoking GnuPG from CGI under Windows 7

robertcInSD robertc at
Thu Aug 9 01:19:14 CEST 2012

I have a question regarding using GPG from a CGI script under Apache. I am
requesting a key from our keyserver. The command I use works fine from the
command line and from a Perl script in the regular user context <sanitized
for confidentiality>
~\gpg.exe  --batch --no-tty --keyserver ldap://<address>
--no-default-keyring --primary-keyring <keyring> --recv-keys <keyid>

If I run the Perl script from Apache as a CGI, I get the following error:
"gpg: can't create directory `C:\WINDOWS\gpg-4568AA': Permission denied
gpg: keyserver communications error: general error
gpg: keyserver receive failed: general error"

My question is two-fold:
1) Is it Apache or GPG that is trying to write a temp file into the system
2) Depending on the answer to 1), what can I do about it? If GPG is doing
it, can it be redirected to a temp directory where Apache has permissions?

View this message in context:
Sent from the GnuPG - User mailing list archive at

More information about the Gnupg-users mailing list