Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6340481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:50:39+00:00 2026-05-24T19:50:39+00:00

To begin, I’ve tried the two solutions found here: GPG Error Code 2 The

  • 0

To begin, I’ve tried the two solutions found here: GPG Error Code 2 The best I could. I don’t quite understand what to set --homedir directory to, so maybe I can still try that method if somebody can help me figure out what to set it to.

In the meantime, I know that GPG works fine in the terminal as Root – and the file is created as expected. It’s this code that fails with error code 2:

<?php
$file = "/path/to/file.gzp";
system("gpg --encrypt --recipient 'shack' --yes --always-trust " . $file, $returnValue);
?>

Anybody know the issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:50:40+00:00Added an answer on May 24, 2026 at 7:50 pm

    This is a permission issue; when php runs on the webserver, it executes as the user www-data , nobody or so, not root. Configure the pgp keys with the user php’s running on (you can test in an interactive shell with su www-data). You may want to specify --homedir /some/directory to store and access the keys in another directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To begin with, let me say that I understand how and why the problem
BEGIN dbms_output.put_line('Welcome to PL/SQL'); END; / I have this code in sample.sql file. How
I cannot pretend to begin to understand how AI software is created, but while
Let me begin by explaining what I'm trying to accomplish. Essentially there are two
Local Variable begin transaction #Code inside transaction object = Class.new attributes raise unless object.save!
Before I begin I want to make it clear that I don't want the
To begin, not only are there two main dialects of the language (Common Lisp
As I begin to develop more and more complicated JavaScript solutions, I wonder what
To begin, I must say that I have searched for quite a long time
To begin i read all resources from xml in my MergedDictionaries and now I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.