I have to import a GPG key in a PHP script, it works using the command line
gpg --import "/home/me/pubkey.txt"
but does not work using the PHP gpg
class with the import
method even with the gnupg_import
function.
My configuration is:
- RedHat Enterprise Linux 5
- PHP 5.1.6
- GnuPG 1.4.5
- GPGme 1.1.8
- GPG extension 1.3.1
I also tried using the exec
or system
functions of PHP, but with no success, with the same command line (exec('cat "/home/me/pubkey.txt"')
works so the file is readable).
Edit: It works on Ubuntu 9.10 Server with GnuPG 1.4.9, PHP 5.2.6.