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):

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):

Try with command from terminal
sudo /opt/lampp/bin/php -v
In my case I have installed XAMPP for Linux (LAMPP) in Ubuntu 18.10
How can you know it?
- Try to go to /opt/lampp
- If you can, it means Xampp for Linux it's installed, but if you want to know the version, in the same path of step 1, put in your command line ./xampp status You will know XAMPP for Linux version and Apache, MySQL and ProFTPD status (running or not).
Know PHP version
cd /opt/lampp/bin
./php -v
Know MySQL (MariaDB) version
cd /opt/lampp/bin
./mysql --version
Know Apache version
cd /opt/lampp/bin
./apachectl -v
I hope helps somebody
./xampp status image
You have to understand this :
1) LAMP
For LAMP setup, you have to install PHP, Apache and Mysql packages separately. In LAMP you don't get anything to manage your server in GUI way.
For Ex: To start apache server you have to type command in terminal.
To start apache : sudo service apache2 start
For installing LAMP refer :
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu
2) XAMPP
It is a complete package which comes bundled with PHP,Apache, Mysql etc in a single installation. It gives you a control panel from which you can manage your server and configuration files.It is something of this sort.

For XAMPP : https://www.apachefriends.org/download.html
If you don't find xampp control panel in your system, this means you have a LAMP setup. i.e : first option.
Open XAMPP Control Panel, hit on the "Help" button and then "View ReadMe" ... It'll open a Notepad file having the first line as:
"###### ApacheFriends XAMPP Version x.y.x ######"
where x.y.z is the XAMPP version!
Go to uninstall software if you are on windows and there you will see the version of your xammp.

Run in command line
<xampp_dir>\apache\bin\httpd -v
It prints Apache version.
For example I had installed XAMPP to C:\Aplikace\xampp directory and type into Command Line
C:\Aplikace\xampp\apache\bin\httpd -v
that responsed

- Go to xampp folder where you installed xampp
- Find apache?
- xampp->apache->bin->httpd->right click->properties->details->version find php version in xampp
- xampp control panel which, after the complete installation, contains start, stop, config, etc.
- There you find shell-> click->type php-v
- mariaDB version in xampp?
- Type localhost/phpmyadmin after installation on url
- Find sql
- Type select version(); and hit enter
If you are using new version of xampp.
Try http://localhost/dashboard/phpinfo.php
Put this code in your root directory or htdocs folder of xampp:
<?php phpinfo(); ?>- Save it as phpinfo.php and point your browser to it (this could be http://localhost/phpinfo.php)
- Example: random image (Click Here)
Here's what I found:
You should be able to find this in the log called 'catalina.out'. Alternatively, you can go right to the source; open $TOMCAT_HOME/server/lib/catalina.jar in a tool capable of handling zip or jar files, and read the file called org/apache/catalina/util/ServerInfo.properties.
That last bit is not guaranteed to work across multiple versions, though.
Personal opinion -- the catalina solution should be perfectly fine.
P.S. your (XAMPP) Tomcat home folder usually lies in $XAMPP/tomcat/
You can simply just start the tomcat in xampp and press admin button or navigate to localhost:8080 in browser and the tomcat homepage will show up with version details and documentation.
Uninstall lampp with the following command:
sudo /opt/lampp/uninstall
This will keep untouched three folders in your installation directory (htdocs, temp and var). Htdocs is the folder which contains the files and var is the folder which contains the databases of all your projects.
Afterwards, change the permissions of the installer you downloaded
chmod 755 xampp-linux-*-installer.run
and run the installer
sudo ./xampp-linux-*-installer.run
All done. XAMPP is now installed under /opt/lampp directory.
Regarding the PPA. If you look at their launchpad page you will see that it is 110 weeks old. By the way: their PPA states it is version 1.8.1. That seems WAY off from your version. Looking at the XAMPP download page that seems to be explained by a skip in version numbering. So do not bother with the PPA; it seems dead.
Looks like their numbering got changed to the PHP version related to the XAMPP version. So you will also want to update PHP to 5.6.3. This might become problematic and you might need to switch to Ubuntu 14.04
Regarding installation from the run file. The "*" in that denotes the version so if you downloaded. 1 thing you need to consider: the version you type is the 32-bit version. If you need the 64-bit version you need xampp-linux-x64-5.6.3-0-installer.run.
You will also need to do the post install alterations. Change your PATH variable to the new download and execute the daemon. Like you did the 1st time.