I'm using gnupg PHP module from pecl. Specifically: gpgme-devel 1.1.8 gnupg module 1.3.3
Encryption works fine, and is fast. Using gpg at the commandline decryption is fast. When I try to decrypt from PHP the page never loads, even messages before the call to decrypt don't print.
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
putenv('GNUPGHOME=/var/www/.gnupg/');
$gpg = new gnupg();
$gpg->seterrormode(gnupg::ERROR_EXCEPTION);
$key_finger_print = 'XXXX'; // Censored for posting...
$phrase = 'XXXX'; // Censored for posting...
$message = 'XXX'; // Censored for posting...
try
{
$gpg->adddecryptkey($key_finger_print,$phrase);
$message = $gpg->decrypt($message)
}
catch(Exception $e)
{
echo 'ERROR: ' . $e->getMessage();
}
?>
No errors are displayed or show up in the log.
Edit: So, running the same script from the command line instead of through apache causes the gpg-agent to prompt me for the pass phrase even though it was supplied in the library call.