I have gone back to trying to actually encrypt a data file. Here is the 'status-file' output that pgp creates. It clearly shows an error on the last line of 'permission denied' on the file I am trying to encrypt 'test.txt'. That is bogus. I have granted all the world r/w to that file and it clearly accesses it becuase the status says it has encrypted the contents. So, really the question is what is permission being denied to?
Some other info: if I run PHP from the command line against this PHP script which calls pgp it works fine - the file gets encrypted. ALso, PERL runs the same commands (using SYSTEM()) when called from the browser. BUT, when the browser is used to call this PHP script it fails. Clearly, there is some permission problem running as 'nobody'.
/export/home/pgphome/.pgp/pubring.pkr:open keyrings (1006:public keyring)
/export/home/pgphome/.pgp/secring.skr:open keyrings (1007:private keyring)
0x221DC947:encrypt (1030:key added to recipient list)
/export/home/eckankar/dev/www/info/test.txt:encrypt (3048:data encrypted with cipher AES-128)
/export/home/eckankar/dev/www/info/test.txt:encrypt (3124:permission denied)
As background here is the argument of the PHP exec() command:
/opt/pgp/bin/pgp --encrypt /export/home/eckankar/dev/inc/test.txt --output /export/home/eckankar/dev/www/info/test.xxx -r membership --overwrite remove --home-dir /export/home/pgphome/.pgp -v --status-file /export/home/eckankar/dev/inc/test.txt.err
ALl the folder/directories in this command have granted 'rwx' to the world.
Here is what the status output file looks like when the encrypt succeeds as it does if run from a command line (/opt/csw/php5/bin/php test.php) rather than through the browser:
pgp:encrypt (3157:current local time 2009-06-30T11:51:17-05:00)
/export/home/pgphome/.pgp/pubring.pkr:open keyrings (1006:public keyring)
/export/home/pgphome/.pgp/secring.skr:open keyrings (1007:private keyring)
0x221DC947:encrypt (1030:key added to recipient list)
/export/home/eckankar/dev/inc/test.txt:encrypt (3048:data encrypted with cipher AES-128)
/export/home/eckankar/dev/inc/test.txt:encrypt (0:output file /export/home/eckankar/dev/inc/test.txt.pgp)