By default on Ubuntu 12.04 LTS gnupg needs to write to .gnupg in the home directory of the user running PHP (so for a web site this is www-data). You might need to make a ~/.gnupg for www-data and chown/chmod it correctly or everything will fail.

After spending so much time I could only install it on Linux and not Windows. There is very little instructions on the net about installation of this module, so I am going to write a small instructions that should help a straightforward installation on Linux without so much trouble.

Step 1: you will need a C++ compiler on your machine. For being sure try this command in the terminal:<?phpsudo apt-get install g++?>Obviously you need GnuPG itself, so try:<?phpsudo apt-get install gnupg?>Step 2: you will need "Libgpg-Error" downloaded and installed on your machine. 2-1: Download the code from http://www.gnupg.org/download/#libgpg-error2-2: Extract it to a directory. In the terminal, change the directory to the Libgpg-error directory.2-3: Configure the package for building and installation with below command:<?php./configure?>2-4: In the same directory make it with below command:<?phpsudo make?>2-5: In the same directory install it with below command:<?phpsudo make install?>

Step 3: you will need "GnuPG Made Easy" (GPGME) downloaded and installed on your machine. Some sources will tell you that you can "apt-get install" it, but actually you cannot. So do it like the latter:3-1: Download the source code from http://www.gnupg.org/download/#gpgme3-2: Extract it to a directory. In the terminal, change the directory to the GPGME directory.3-3: Configure the package for building and installation with below command:<?php./configure?>3-4: In the same directory make it with below command:<?phpsudo make?>3-5: In the same directory install it with below command:<?phpsudo make install?>

Step 4: Given that you have a LAMP server already and have php installed, you will need "pear" and "php source codes". To add them use below commands:<?phpsudo apt-get install php5-devsudo apt-get install php-pear?>