create a file (say info.php) with the following content on an accessible path and try to browse it:
<?phpphpinfo();?>
@Alfabravo is correct: don't forget to delete the file from the server after using it!
Create a PHP script called php.php with the content:
and run it from your browser. Or from command line, run:
php -v
I don't know with what PHP version it became available, but try this:
if( strpos( $_SERVER['SERVER_SOFTWARE'], 'Apache') !== false) echo 'Have Apache';else echo 'Have some other server';