Official PHP gnupg extension repository
Find a file
Jakub Zelenka 9ccd9aadfa
Convert all functions to use objects and drop a resource (#64)
This is a breaking changes but impact should be quite small - only users
that use is_resource will need to update code.
2026-01-07 19:59:02 +01:00
.github/workflows Remove ubuntu-20.04 from CI 2025-04-22 15:31:55 +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
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 Remove compatibility with PHP 7.1 and older (#63) 2025-12-06 17:34:02 +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.

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