[PHP] System() and PGP

2001-07-18 Thread David Price

I have been trying to run PGP commands within PHP with the system()
function.  PGP is installed on the web server, and all the commands work
fine when I'm su'ed as the nobody user (the web server user).

I can use this command to encrypt messages:

system("pgp -ea $plainTxt 'David Price <[EMAIL PROTECTED]>'");

without any problems.  But when I try,

 system("pgp");

I don't get any output.  It should display the general help text.  I can run
other commands like ls and ps without any problems as well.  Does anyone
know what is going on here?

Thanks for your help,

David Price


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] System() and PGP

2001-07-19 Thread Maxim Derkachev

Hello David,

Thursday, July 19, 2001, 8:48:17 AM, you wrote:

DP> I can use this command to encrypt messages:

DP> system("pgp -ea $plainTxt 'David Price <[EMAIL PROTECTED]>'");

DP> without any problems.  But when I try,

DP>  system("pgp");

DP> I don't get any output.  It should display the general help text.

It does. But it sends the output to STDERR, which PHP doesn't have access
to. If you do this with apache, the output will go straight to the
apache, omitting PHP, if from a shell with PHP executable, the lines go
to the shell's tty.



-- 
Best regards,
Maxim Derkachev mailto:[EMAIL PROTECTED]
System administrator & programmer,
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
www.books.ru, www.symbol.ru 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] System() and PGP

2001-07-19 Thread David Price

Thanks for reply,

I'm using apache, so is there away to get the output sent to PHP?  Someone
suggested using system("pgp 2>&1"); but all I get is:
Pretty Good Privacy(tm) Version 6.5.1i (c) 1999 Network Associates Inc.
Export of this software may be restricted by the U.S. government. No
configuration file found. Error!!! insufficient random bits

Not quite what I had in mind but a step in the right direction.  Any ideas?

Thanks for the help

David Price

-Original Message-
From: Maxim Derkachev [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 1:05 AM
To: David Price
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] System() and PGP


Hello David,

Thursday, July 19, 2001, 8:48:17 AM, you wrote:

DP> I can use this command to encrypt messages:

DP> system("pgp -ea $plainTxt 'David Price
<[EMAIL PROTECTED]>'");

DP> without any problems.  But when I try,

DP>  system("pgp");

DP> I don't get any output.  It should display the general help text.

It does. But it sends the output to STDERR, which PHP doesn't have access
to. If you do this with apache, the output will go straight to the
apache, omitting PHP, if from a shell with PHP executable, the lines go
to the shell's tty.



--
Best regards,
Maxim Derkachev mailto:[EMAIL PROTECTED]
System administrator & programmer,
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
www.books.ru, www.symbol.ru



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re[2]: [PHP] System() and PGP

2001-07-20 Thread Maxim Derkachev

Hello David,

Friday, July 20, 2001, 5:50:32 AM, you wrote:
DP> I'm using apache, so is there away to get the output sent to PHP?  Someone
DP> suggested using system("pgp 2>&1"); but all I get is:
DP> Pretty Good Privacy(tm) Version 6.5.1i (c) 1999 Network Associates Inc.
DP> Export of this software may be restricted by the U.S. government. No
DP> configuration file found. Error!!! insufficient random bits

DP> Not quite what I had in mind but a step in the right direction.  Any ideas?

You've got pretty error message from STDERR :)
It could not find you keyring and tried to compute a new instead.
Failed. Complained.
Look at phpclasses.upperdesign.com. There are classes for both
GPG (mine)  and PGP (other guy's) encryption. I guess you'll find the
working pattern there.


-- 
Best regards,
Maxim Derkachev mailto:[EMAIL PROTECTED]
System administrator & programmer,
Symbol-Plus Publishing Ltd.
phone: +7 (812) 324-53-53
www.books.ru, www.symbol.ru 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]