You cannot open PHP Scripts via "Open file...", instead you MUST enter a valid URL for your test files.
The local Xampp URL always starts with
http://localhost/.... followed by folder/filename as given on your system. As well, you CANNOT open files from your home directory or similar, all PHP/HTML files have to be stored in /opt/lampp/htdocs. And nowhere else.
If you save a file (for example) as /opt/lampp/htdocs/myfolder/myfile.html, you MUST enter
http://localhost/myfolder/myfile.html into your browser (so, /opt/lampp/htdocs is the so called "DocumentRoot" for your
http://localhost).
You URGENTLY have to read about webservers and Apache and have to learn the very very basics.