Page 1 of 1

can't run exec() through php

Posted: Thu May 19, 2005 8:17 am
by mustatin
HI
I have a php file which is having

$gpg = '/usr/bin/gpg';

$recipient = 'admin@aol.com';
putenv("GNUPGHOME=/root/.gnupg");

$ecommand = "$gpg -r $recipient -a --encrypt message.txt";

exec($ecommand, $results, $retrn);

but this does not enrypts the message.txt

Or command doesn't work when i give it in exec() function.
But this command works when i give it from SSH.

My safe_mode variable is also not set , i mean safe_mode is null

Please help me out.

Thank you all for your help.

Posted: Thu May 19, 2005 11:22 am
by Skara

Code: Select all

$ecommand = "$gpg -are $recipient -a --encrypt message.txt 2>errors";
Never used gpg. Sure it's not trying to put the encrypted file into $results?