What is the recommended way to test if PHP is installed on a server?

To test if PHP is installed on a server, you can create a simple PHP script that will display the PHP version information when accessed through a web browser. This can help confirm that PHP is running on the server and provide insight into the PHP version being used.

<?php
phpinfo();
?>