How can I force GPG to accept input from STDIN instead of trying to open a file?
问题 I am trying to incorporate GPG clear-signing of text in a string in a PHP script. I can cause GPG to encrypt text in a string like this: $encrypted = shell_exec("echo '$text' | gpg -e -a -r foo@bar.com --trust-model always"); and that works perfectly, with the encrypted text being sent to the $encrypted variable. This proves GNUPGHOME and GNUPG are set up correctly. However, when I try to produce a clear-signed message in the same way with this: $text = "googar"; $signature = exec("echo