I have this PHP script:
<?php
$od = shell_exec('od /dev/hwrng --address-radix=n --read-bytes=4 --format=u4');
?>
<html>
<head>
<title>hwrng</title>
</head>
<body>
<?php echo $od; ?>
</body>
</html>
The bash command works as expected when I'm in the shell, but not when called inside PHP through shell_exec(), infact it doesn't produce any output. I noticed that replacing /dev/hwrng with /dev/random solves the problem, however I really need to use /dev/hwrng in my script, but I can't figure out what's wrong. Thanks for helping!