What steps can be taken to troubleshoot PHP code that is not displaying an image as expected, even when the image address is correct?

The issue may be due to incorrect file permissions on the image file or a typo in the image address. To troubleshoot, check the file permissions of the image file to ensure it is readable by the PHP script. Additionally, double-check the image address for any typos or errors.

<?php
$image_path = 'path/to/image.jpg';

if (file_exists($image_path)) {
    echo '<img src="' . $image_path . '" alt="Image">';
} else {
    echo 'Image not found.';
}
?>