If you are using new version of xampp.
Try http://localhost/dashboard/phpinfo.php
Answer from Prosenjeet Paul on Stack OverflowIf 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)
Is there a way to upgrade version of PHP of my local XAMPP without destroying anything??
PHP Version confusion (OSX, XAMPP)
How to check PHP version?
How to use multiple versions of php
Videos
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
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
So yesterday I was viewing a course where the tutor installed composer and through that downloaded twig version 3.0. I tried to do that but it stuck saying I dont have php v.7.2 or smth like that so i downloaded twig v.2.0 and all worked well.
That though, made me think. I've got that XAMPP portable in my USB stick for years now. Sometime I'll need to update php version and i guess many more.
Is there a way to do this without destroying anything in the XAMPP files?
Currently working my way through some PHP tutorials and in VSCode and browser (Chrome with Live Server extension) I'm getting a syntax error when using 'fat arrow' shorthand for anonymous functions. Then I read the arrow shorthand was only introduced in PHP 7.4. What is confusing me is that a) I installed XAMPP with PHP 8.1, b) my system PHP ('php --version') is 7.4.2 but if I display the PHP version number in code in the browser it outputs 7.3.x. Also, if I open the XAMPP server and go to PHP Info it displays 8.1.4
I have PHP 7.3.x and 7.4.x installed (via homebrew) though I don't actually remember ever installing 7.3.x (maybe it got installed with Node?)
My question I suppose is how to I tell VSCode and Chrome to use a specific version of PHP? Or how do I remove 7.3.x and at least make 7.4.x the default?