PGP commands problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I have a little problem with signing e-mails from PHP.
The little piece of code giving me headaches is this:

<?php
$data     = "some data here...";
$tmp_file = tempnam('/tmp','PGP');
putenv("PGPPATH=/home/nobody/.pgp");
putenv("HOME=/home/nobody");
exec("echo " . escapeshellarg($data) . " > $tmp_file");
exec("cat $tmp_file | pgp -sta -u Alex -o $tmp_file");
?>

If I run it from shell with 
# php -f pgp_sign.php
it works as expected, I get one temporary file containing
the unsigned data, and one secondfile with an extra ".asc"
extension, with the data signed with the chosen key.

If I run it from the browser however it just shows loading....
loading..., loading... forever! It never gives an error (well,
I did not wait forever, that's true, my time on Earth is limited ;)
and it never gets "loaded" either. When I look at the files
that it should create, I see the first is created ok, but the
second is not. The test script, does belong to nobody user, 
just like the /home/nobody and just like the user the apache
is run under:

httpd.conf:
...
User nobody
Group nobody
...

PHP Safe Mode is Off and in the error log I see this:

Pretty Good Privacy(tm) Version 6.5.8
(c) 1999 Network Associates Inc.
Uses the RSAREF(tm) Toolkit, which is copyright RSA Data Security, Inc.
Export of this software may be restricted by the U.S. government.

Pretty Good Privacy(tm) Version 6.5.8
(c) 1999 Network Associates Inc.
Uses the RSAREF(tm) Toolkit, which is copyright RSA Data Security, Inc.
Export of this software may be restricted by the U.S. government.


Has anybody had any similar experience? Has anybody worked it out? :)
If anybody could help I would really appreciate,
Thank you in advance,

Have a nice day everyone,
Alex

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux