Official PHP gnupg extension repository
  • C 57.7%
  • PHP 40.5%
  • M4 1.8%
Find a file
Venca Krecl 769f032a7c
Add CI job that installs the extension with PIE
Prove the composer.json works end to end: a `pie-install` job downloads a
pinned pie.phar, runs `pie install` from the checkout, and verifies the
gnupg extension is loaded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 17:37:31 +02:00
.github/workflows Add CI job that installs the extension with PIE 2026-07-19 17:37:31 +02:00
tests Fix typos in tests 2025-09-11 12:38:08 +02:00
.gitignore Ignore config.cache 2025-03-18 17:37:06 +01:00
.gitmodules Make initial port to phpc 2016-05-21 21:27:06 +01:00
composer.json Add PIE support (GH-56) 2026-07-19 17:34:16 +02:00
config.m4 Add /opt/homebrew to the configuration SEARCH_PATH (#43) 2022-02-20 21:06:23 +00:00
EXPERIMENTAL initial release 2005-10-07 18:59:50 +00:00
gnupg.c Convert all functions to use objects and drop a resource (#64) 2026-01-07 19:59:02 +01:00
gnupg_keylistiterator.c Remove compatibility with PHP 7.1 and older (#63) 2025-12-06 17:34:02 +01:00
LICENSE Update LICENSE file 2016-07-24 19:01:52 +01:00
NEWS.md Convert all functions to use objects and drop a resource (#64) 2026-01-07 19:59:02 +01:00
package.xml Release 1.5.4 2025-08-08 15:01:04 +02:00
php_gnupg.h Remove compatibility with PHP 7.1 and older (#63) 2025-12-06 17:34:02 +01:00
php_gnupg_compat.h Remove compatibility with PHP 7.1 and older (#63) 2025-12-06 17:34:02 +01:00
php_gnupg_keylistiterator.h Remove compatibility with PHP 7.1 and older (#63) 2025-12-06 17:34:02 +01:00
README.md Add PIE support (GH-56) 2026-07-19 17:34:16 +02:00
UPGRADING.md Convert all functions to use objects and drop a resource (#64) 2026-01-07 19:59:02 +01:00

PHP GnuPG

The php-gnupg is a wrapper for GpgME library that provides access to GnuPG.

Installation

Linux

Before starting with installation of this extensions, the GpgME library has to be installed. It has got installation packages on the most Linux distributions. The minimal version of GpgME that is supported is 1.3.0. The extension supports GnuPG version 1 and 2.

Of course PHP has to be installed too. The minimal version that is supported is 5.3.2.

PIE

This extension can be installed with PIE, the modern successor to PECL.

$ pie install php-gnupg/gnupg

PECL

This extension is available on PECL.

$ sudo pecl install gnupg

Manual Installation

It's important to have a git installed

First clone the repository

git clone https://github.com/php-gnupg/php-gnupg.git

Then go to the created directory and compile the extension. The PHP development package has to be installed (command phpize must be available).

cd php-gnupg
phpize
./configure
make
sudo make install

Finally the following line needs to be added to php.ini

extension=gnupg.so

or for PHP 8+ it's just

extension=gnupg

Windows

The extension is not currently supported on Windows due to unavailable GpgME library builds that would be supported by PHP.

Documentation

The extension documentation is now available in the PHP-Manual: http://php.net/manual/en/book.gnupg.php