title: GPG decrypts file with no content/as empty file
body: <p>i am struggling with a gpg problem for a few days and cant figure out a solution by my own. i would be glad if you could help me out with the following issue:</p>
  
  <p>i need to decrypt a gpg file in php. for that, i am using the following command:</p>
  
  <pre><code>cat passphrase.txt | /usr/local/bin/gpg --decrypt --passphrase-fd 0 stammdaten.txt.gpg&gt;stammdaten.txt
  
  the passphrase.txt contains the password for decryption
  stammdaten.txt.gpg is the encrypted file
  the decrypted data will be written in stammdaten.txt
  
  when i run this command in php:
  
  
  shell_exec=("cat passphrase.txt | /usr/local/bin/gpg --decrypt --passphrase-fd 0 stammdaten.txt.gpg&gt;stammdaten.txt")
  
  
  i get a zero-byte output file (stammdaten.txt) with owner=ftpadmin and group=psacln
  
  but when i execute the same command via ssh terminal (as root), the data will be decrypted and written correctly with file owner=root and group=root.
  </code></pre>
  
  <p>i think, that this is a permission problem. how can i use that command in php correctly? i also tried to chown and chgrp with the ftprightson the decrypted file, but nothing seems to help.</p>
  
  <p>every answer is highly appreciated. thanks!</p>