Howto: Installing GnuPG for php 5.3 on Centos6

Posted on Updated on

What is GnuPG ?

GNU Privacy Guard(gnupg) is a cryptographic software mostly used for Filecrypt, it is available for the following tools bash,php,python,perl modules. The statergy for using GnuPG is to be secure the data while digital transportation.

Please refer the Wiki for more information : http://en.wikipedia.org/wiki/GNU_Privacy_Guard

I followed the below steps to install GnuPG.

1, Install Dependency packages gnupg libgpg-error gpgme libgpg-error-devel gpgme-devel
2, Install/Enable PHP module
3, Restart Apache

Install dependencies:

[root@planetcure:~]# yum install gnupg libgpg-error gpgme libgpg-error-devel gpgme-devel php-devel

Installing PHP module using PECL repository

[root@planetcure:~]# pecl install gnupg

Enabling php support

[root@planetcure:~]# echo -e '; Enable GnuPG extension module\nextension=gnupg.so' > $(php --ini | grep "additional .ini" | awk -F: '{print $2}')/gnupg.ini

Verifying installation

[root@planetcure:~]# php --info | grep gnupg
gnupg
gnupg support => enabled

Restarting Httpd

[root@planetcure:~]# service httpd restart

If you need to check through PHP info , create a file info.php with the below code and place it into the web root directory. then call the file through browser it will be looks like the below image.

cat info.php
<?php
phpinfo();
?>

gnupg

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s