title: GPG Error Code 2
body: <p>GPG is always returning 2 at the result. My code is as follows</p>
  
  <p><code>$cmd = "/usr/bin/gpg -a --recipient $to -e -o $outfile $infile";</code></p>
  
  <p>Where outfile is the file where the encrypted data will be written and infile is the unencrypted data.</p>
  
  <p>I don't know why this is happening. Can anyone please tell me what's wrong. Thanks.</p>