title: PGP encryption from PHP
body: <p>If I run the command</p>
  
  <pre><code>gpg -e -r john@doe.com my_secret_file.txt
  </code></pre>
  
  <p>from unix command prompt, it is working fine. But when I try to use the same command using PHP, it's not working :</p>
  
  <pre><code>$gpg = '/usr/bin/gpg';
  $recipient = 'john@doe.com';
  $secret_file = 'secret_file.txt';
  
  echo shell_exec("$gpg -e -r $recipient $secret_file");
  </code></pre>
  
  <p>Please guide me for a solution.</p>