Don't install IIS again if you are using XAMPP - use one or the other.
Your test.php file is best in the htdocs folder then http://localhost/test.php
should find it.
Look in C:\Windows\system32\drivers\etc\HOSTS file (drag it into notepad).
Find this line:
Comment it out like so
# ::1 localhost
Save and close the file.
Now instead of using http://127.0.0.1
you will also be able to use http://localhost
PHP files have to be parsed by the server so double clicking on a PHP file will not load it.
Try and reboot after all the changes and see if these issues have been cleared up.
XAMPP is excellent and should work out of the box if all installation instruction are observed.
BTW you posted while I was compiling this reply.