Re: [PHP] Using GPG in Safe Mode
On Mon, January 16, 2006 8:28 pm, [EMAIL PROTECTED] wrote: My ISP have php set for safe mode. And now I'm trying to run gpg from php. Basically I'm trying to run this from exec(): echo testar testar | /usr/local/bin/gpg --homedir /home/myuser/ .gnupg -a --always-trust --batch --no-secmem-warning -e -u Test Test [EMAIL PROTECTED] .com -r Test Test test@test.com When I run it from cli myself it works fine, but it fails when I run it from php. Are there anyway I can get this to work? Fails how, with what error message?... Are you using the optional arguments to exec to get the OS error messages back? If not, fix that now, before you do anything else. If safe mode won't let you do exec() at all, you are stuck. If safe mode won't let you run /usr/local/bin/gpg, you are stuck. If safe mode won't let you run echo, or |, you are stuck. If safe mode won't let you read /home/myuser/.gnupg, you are maybe kind of stuck... You can make it world readable, and then maybe PHP can read it, but so can everybody else on that same machine, which may be too risky for whatever you intend to use GPG for in the first place. After you get it work with exec, switch to popen, because exec will expose your data to ps and top and such-like. popen has your data in clear in RAM, but if users can peek into your RAM at will and find the data, you have much bigger problems (probably) then them being able to read your data. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using GPG in Safe Mode
Hello, My ISP have php set for safe mode. And now I'm trying to run gpg from php. Basically I'm trying to run this from exec(): echo testar testar | /usr/local/bin/gpg --homedir /home/myuser/ .gnupg -a --always-trust --batch --no-secmem-warning -e -u Test Test [EMAIL PROTECTED] .com -r Test Test test@test.com When I run it from cli myself it works fine, but it fails when I run it from php. Are there anyway I can get this to work? Sorry if this is OT or an obvious question. /Regards Emil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using GPG in Safe Mode
Hi emil ! If you are using gnupg comand line, there is not way on PHP-safe mode. The only way that i know to wrap around this problem it's install pecl extension package calls gnupg (http://pecl.php.net/package/gnupg). This extension use libgpgme that bind all gnupg comand line options, then it don't have problems with safe mode. i don't know if this tips it's useful in your case, but it's the only solutions that i know. On 1/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, My ISP have php set for safe mode. And now I'm trying to run gpg from php. Basically I'm trying to run this from exec(): echo testar testar | /usr/local/bin/gpg --homedir /home/myuser/ .gnupg -a --always-trust --batch --no-secmem-warning -e -u Test Test test@test.com -r Test Test test@test.com When I run it from cli myself it works fine, but it fails when I run it from php. Are there anyway I can get this to work? Sorry if this is OT or an obvious question. /Regards Emil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php