How to install GNUPG PHP Extension


How to install GNUPG PHP Extension


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.

root@server [~]# php -i | grep gnupg
gnupg
gnupg support => enabled

 

Bu cevap yeterince yardımcı oldu mu?

Diğer Dökümanlar


  • cPanel security settings checklist

    You always use cpanel recommended Security Settings to avoid hacking and other suspicious activity. These  cPanel Server Hardening & Security tips will help prevent from hacking. cPanel...

  • sendmail Not running with correct effective GID

    Wed Sep 04 04:11:11 2014] [error] [client 11.44.33.22] sendmail: Not running with correct effective GID.  Is sendmail binary setgid mailtrap?, It may be the problem with your sendmail binary...

  • How to enable NAT behind the cpanel ?

    Most of webhosting providers currently used NAT service for their users. When you install cPanel & WHM, the installer will detect whether your server is on a NAT-configured network. If the...

  • Unable to allocate memory for pool

    Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0 APC or Alternative PHP Cache (APC) is a free and open opcode cache for PHP. APC allows for caching of opcode generated...

  • Install FFmpeg, Mplayer, Mencoder, MP4Box, Flvtool2

    You can use the following tutorial to install ffmpeg and other video modules in your centos server. FFmpeg is an audio/video conversion tool. It includes libavcodec, the leading open source codec...