php gnupg get_key failed error

前端 未结 1 1898
萌比男神i
萌比男神i 2021-01-20 22:25

I am trying to decrypt a simple message with PGP(gnupg) in PHP. But I always get this error: get_key failed. On stack-overflow I see many people with this probl

1条回答
  •  孤城傲影
    2021-01-20 22:47

    The code in the thread is fine, but have in mind your nginx user is different than user and nginx will have issues accessing its gnupg keys because (by default) /home/user/.gnupg is only OWNER (user login) accessible. Easiest thing would be to set home directory for the nginx user and create its own gnupg keys for this purpose. Otherwise running this php will only succeed when you are logged in into terminal using the user login (because /home/user/.gnupg)

    0 讨论(0)
提交回复
热议问题