You are here: GnuPG in PHP Problems « All PHP « IT news, forums, messages
GnuPG in PHP Problems

Posted by r_irwin_rabc on 03/08/07 00:21

Hi there,

I'm very sorry to have to everyone but I've exhausted all options to
get this to work. The gpg command is working fine on an apache server
through the command prompt - I've added a key and successfully
encrypted. However, I cannot get it working in PHP. The strange thing
is it did previously work but now I just get "gpg: command not found"
- I've no idea why this has stopped working.

My path is /usr/local/bin/gpg
The .gnupg folder contains:
666 trustdb.gpg
604 secring.gpg
604 random_seed
644 pubring.gpg
644 options

I'm using the following code (using same command as I would in SSH)
where the test.txt file contains some example text and user@domain
would be my email user in the key ring:

$gpg = '/usr/local/bin/gpg';
$oldhome = getEnv("HOME");
putenv("HOME=$gpg");
echo shell_exec("gpg -a --always-trust --batch --no-secmem-warning -e -
r user@domain.com test.txt");
putenv("HOME=$oldhome");

Has anybody got any suggestions?

Robin.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация