There are a few errors here.
$files = glob("/var/www/html/Images");
This line doesn't make a lot of sense as written.
glob returns an array matching the glob pattern (the sort of pattern you use in your terminal, e.g.
/var/www/html/Images/*.jpg). Your code doesn't get an array of images, as you're expecting here.
$num = $files[$i];
echo '<img src="'.$num.'" alt="random image">'." ";
You're using the full local file path, so even with the glob being correct, you'd be getting output like so:
<img src="/var/www/html/Images/foo.jpg" alt="random image">
Clearly, you don't want the
/var/www/html bit, because that path isn't accessible to browsers. You probably want to translate that to the URL path, as hosted by Apache. There are some suggestions on Stack Overflow how to handle that, which you might like to review. One of the suggestions is:
$num = str_replace($_SERVER['DOCUMENT_ROOT'], '', $num)
This should technically resolve the issue, as long as you sort out the glob. Bear in mind this isn't terribly secure or good practice, though, but it does address your immediate problem.