How can one determine if a web server supports PHP before attempting to install PHP scripts?

To determine if a web server supports PHP before attempting to install PHP scripts, you can create a simple PHP file with the phpinfo() function and access it through a web browser. If the PHP information page loads successfully, then PHP is supported on the server. If the page does not load or displays an error, then PHP may not be supported or properly configured on the server.

<?php
phpinfo();
?>