Hi,
I'm trying to create a file using gpg, I'm doing
$plainTxt = ("$DOCUMENT_ROOT" . "$tmpToken" . "data");
$crypted = ("$DOCUMENT_ROOT" . "$tmpToken" . "gpgdata");
$fp = fopen($plainTxt, "w+");
fputs($fp, $message);
fclose($fp);
system("/usr/bin/gpg --encrypt -ao $crypted -r 'MyKey' $plainTxt");
$fd = fopen($crypted, "r");
$mail_cont = fread($fd, filesize($crypted));
fclose($fd);
However i get an error when I run it, saying: -
Warning: fopen("93e859f5d29407de96c930187e24742cgpgdata","r") - No such file or directory
Warning: Supplied argument is not a valid File-Handle resource
I don't think
system("/usr/bin/gpg --encrypt -ao $crypted -r 'MyKey' $plainTxt");
Is workimg, and creating the file! Anyone know why not? I have run 'gpg --encrypt -ao encryptedfile -r 'MyKey' uncryptedfile' in to gpg via telnet, and it worked fine!
What am I doing wrong?
Cheers
Ben