How to know what version of PHP is used on my xampp?

Put this in your root directory:

<?php
phpinfo();
?>

Save it as phpinfo.php and point your browser to it (this could be http://localhost/phpinfo.php)

  • More information (you can get much more information than just the version).
  • Example (random image):

Screenshot of phpinfo() output


Try with command from terminal

sudo /opt/lampp/bin/php -v