PECL installed gnupg calls return null

438 views Asked by At

I recently installed gnupg using PECL to my MAMP PHP install.

extension_loaded('gnupg'); // returns true

My PHP code is able to recognized the gnupg calls, but every call I make seems to return null, as if nothing is happening on the back end.

I'm able to create a new gnupg() object and call import on that object, but this returns null. According to the documentation, it should return FALSE on failure.

$gpg = new gnupg();
$key = "-----BEGIN PGP PUBLIC KEY BLOCK----- ..."; //truncated for posting on SO
$info = $gpg->import($key); // returns null

I have also tried to run export() using the example code in the documentation as a sanity check, but received the same null result.

The PECL install process results in the following:

Build process completed successfully
Installing '/Applications/MAMP/bin/php/php5.6.7/lib/php/extensions/no-debug-non-zts-20131226/gnupg.so'
install ok: channel://pecl.php.net/gnupg-1.3.6

I see gnupg.so but I do not see a gnupg.a file. Nearly all the other .so files in that folder have a related .a file, could that file be missing and that's why I'm getting strange results?

Has anyone run into this before?

EDIT:

Referenced documentation: http://php.net/manual/en/ref.gnupg.php

0

There are 0 answers