How can one test if PHP is functioning on a server, and what are the steps to do so effectively?

To test if PHP is functioning on a server, you can create a simple PHP file that outputs information about the PHP configuration and run it in a web browser. This will help you determine if PHP is installed and working properly on the server.

<?php
phpinfo();
?>