Using gpg from PHP system call

Andre Flitsch andre@pixel-works.co.uk
Tue Feb 26 00:20:02 2002


Hi Tom

You will be able to execute gnupg via telnet as you are authenticated as
part of a group with permission to  execute gnupg. When executing from the
web server the script runs as as nobody or Apache - a group with no
permissions. You have to set the permissions of the files in the gnupg home
directory (/path/to/home/.gnupg) to be executable by the world. I had the
same problem with a php script. When i chmod'd the files to 777 gnupg was
able to execute and create the encoded file.

I hope that helps.

later

Andre

-- >>-----Original Message-----
-- >>From: gnupg-users-admin@gnupg.org
-- >>[mailto:gnupg-users-admin@gnupg.org]On
-- >>Behalf Of Tom Bellucco
-- >>Sent: 23 February 2002 21:57
-- >>To: gnupg-users@gnupg.org
-- >>Subject: Using gpg from PHP system call
-- >>
-- >>
-- >>The article on this page:
-- >>
-- >>http://hotwired.lycos.com/webmonkey/00/20/index3a_page5.html
-- >>
-- >>explains how to call gpg from within a PHP script by
-- >>way of a system call to encrypt the contents of a
-- >>form, then e-mail it.  I have followed all of the
-- >>instructions to get gnupg installed properly (thanks
-- >>to David Shaw!!) but when running the script, the call
-- >>to gpg is failing.  I know this because my script
-- >>tells me it can not open the file which would contain
-- >>the output from the call to gpg (the error says the
-- >>file does not exist).  I've tried sleeping after the
-- >>call to gpg thinking it never had a chance to finish,
-- >>but no go.  I commented out the 2 calls that delete
-- >>the data files, and the output from gpg never gets
-- >>created.  When I telnet to my web server and run this
-- >>command letter for letter manually, it works.  For
-- >>some reason it is not able to run when called from
-- >>within the script.
-- >>
-- >>Has anyone on the list done this, or is anyone using
-- >>gpg in conjunction with PHP to do something similar?
-- >>
-- >>Thanks,
-- >>Tom B.