Are there any common pitfalls to avoid when checking for PHP installation on a server?

One common pitfall to avoid when checking for PHP installation on a server is assuming that the presence of the PHP binary means that PHP is fully installed and configured correctly. It's important to also check for the PHP configuration file (php.ini) and ensure that it is properly set up. Additionally, make sure that the web server (e.g. Apache, Nginx) is configured to work with PHP.

<?php
// Check if PHP is installed
if (function_exists('phpversion')) {
    echo 'PHP is installed on this server.';
} else {
    echo 'PHP is not installed on this server.';
}