What are the potential reasons for seeing only the code of a PHP file when it is opened from an HTML file?

When opening a PHP file from an HTML file and only seeing the code, it could be due to the PHP code not being executed by the server. This can happen if the file extension is incorrect or if the server is not configured to interpret PHP code. To solve this issue, make sure the file has a .php extension and that it is being served by a PHP-enabled server.

<?php
// Your PHP code here
?>