Official PHP gnupg extension repository
  • C 58.4%
  • PHP 39.8%
  • M4 1.8%
Find a file
Venca Krecl 4af7b85c97
Add PIE support (GH-56)
Declare the extension metadata and GpgME dependency for PIE, document installation, and verify a PIE install from the checkout in CI.
2026-11-22 14:39:48 +01:00
.github/workflows Add PIE support (GH-56) 2026-11-22 14:39:48 +01:00
tests Fix flaky tests by disallowing parallel run 2026-11-22 14:12:43 +01: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-11-22 14:39:48 +01: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 Fix addsignkey arginfo to make passphrase optional 2026-11-22 14:04:47 +01:00
gnupg_keylistiterator.c Fix keylistiterator crashes, arginfo and return types 2026-11-22 14:04:47 +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 Fix flaky tests by disallowing parallel run 2026-11-22 14:12:43 +01: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 Fix build with PHP 8.0 and older by defining tentative return type macro 2026-11-22 14:15:26 +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-11-22 14:39:48 +01: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 1.5.0 or later, 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