I'm having a problem with PHP that I've never seen before, I'm using the GnuPG class to generate encrypted messages, but I can not use it in browser, I was wondering why, but I'm not sure, the generated variable always goes empty in the browser, but the terminal is printed perfectly.
Code:
<?php
$text = "ISSO É UM TESTE";
$enc = encrypt($text);
print $enc;
function encrypt($text){
$gpg = new gnupg();
$gpg->addencryptkey("KEY_AQUI");
$enc = $gpg->encrypt("$text");
return $enc;
}
?>
In the browser, it simply does not work, the page is blank, in the terminal I get results, as in the image below: