gpg and PHP (return value 2)

Pete Croft pete at
Wed Nov 9 13:08:16 CET 2005


I expect I'm being an idiot, and will be mortified by the answer, but
having searched the web and assorted archives, I can't turn up an answer
so I thought I'd brave the list ...

I've installed gpg on a couple of boxes (Windows Server 2003/IIS and a
Suse/Apache machine).

Used from the CLI it works just fine on both.

Any attempts to use it via a PHP script consistently fail with a return
code of "2", and to date I haven't managed to track down a list of error
return values.

I suspect it's a permissions problem:  the source file for encryption
exists, the key is correct, and the exact same command issued via CLI
produces the output file as desired, so in the absence of other evidence
I'm guessing that the user PHP's running as can't get to gpg, or doesn't
have permission to execute it?

Any pointers/solutions would be most welcome, as this is driving me
quietly mad.



More information about the Gnupg-users mailing list