문제

I am trying to encrypt a string using a command created in C in my remote server where my database is located. But shell_exec keeps giving me a call to undefined function error. What are the steps to make this function defined? Am I using this function correct?

function encrypt($string) {
    $output = shell_exec('');
    echo "<pre>$output</pre>"; 
}

$string = "some_string"; 
$encryptedString = encrypt($string); 
도움이 되었습니까?

해결책

You need to blacklist the shell_exec from the safe mode.

Sidenote : If it works, you need to escape the $string using the escapeshellarg() before passing it to your shell_exec() function.

Like this..

function encryptTFS($string) {
    $output = shell_exec('tea32 -e -"'.escapeshellarg($string).'" -ofilenameoutout');
    echo "<pre>$output</pre>"; 
}

$string = "some_string"; 
$encryptedString = encryptTFS($string); 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top