当我们使用Symfony\Component\Process\Process
时,命令以谁的身份运行?
我尝试了命令whoami
,Process
但它返回无效???
$return = exec('whoami');
echo $return."\n"; // return [myname]
$process = new Process('whoami'); // The symfony process
echo $process->getOutput(); // return nothing @_@