I have my PHP installed in form of LAMPP in my /opt/lampp folder. The problem is that PhpStorm is unable to see /opt folder and that's why I am unable to set PHP interpreter in PhpStorm.
Does anyone knows what the issue might be? I have pasted a picture as well showing the folder structure in file explorer as well as in PhpStorm.
Just to let you know that I have installed PhpStorm from flatpak...

I had the same problem.
I ended up removing the flatpack version and installing the official one. I used the tutorial from the official JetBrains page (see below), installed toolbox first, and then phpstorm from the toolbox, and that version had all the folders available.
https://www.jetbrains.com/help/phpstorm/installation-guide.html#toolbox