GnuPG is the GNU project’s complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories. GnuPG, also known as GPG, is a command line tool with features for easy integration with other applications.

Installation process is very straightforward provided you met the requirements like php-pear, gnupg, libgpg-error, and gpgme. You can install it directly from WHM -> Module Installers -> PHP Pecl, enter gnupg and click the Install button.

You can do the same via shell with this command pecl install gnupg.

Then restart your Apache.

/etc/init.d/httpd restart

Be sure to double check if the extension was added to you php.ini.

cat /usr/local/lib/php.ini | grep gnupg.so

or

You can download and install it from source.

http://pecl.php.net/package/gnupg/docs

Install requirements

On Cpanel servers most of the requirements are present, like php-pear (if you compiled your apache/php with pear), gnupg, libgpg-error, etc, except for gpgme which is the main library used by gnupg extension.

Install gpgme

You can install gpgme from rpm packages.

Download rpm from mirrors.
http://pkgs.org/centos-6-rhel-6/centos-rhel-x86_64/

gpgme rpm location.

wget http://mirror.centos.org/centos/6/os/x86_64/Packages/gpgme-1.1.8-3.el6.x86_64.rpm

rpm -ivh gpgme-1.1.8-3.el6.x86_64.rpm

If you have any dependancy errors, download it from mirrors and install it.

If you have encountered an error library path when I check the extension,

error while loading shared libraries: libgpgme.so.11: cannot open shared object file: No such file or directory

add /usr/local/lib to /etc/ld.so.conf and run ldconfig, so that libraries in this directory are detected automatically.

Verify gnupg extension with php.

[email protected] [~]# php -i | grep gnupg
gnupg
gnupg support => enabled

 

3.75 avg. rating (78% score) - 4 votes
Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive