How to open php files in the browser

Newbie question. How do I configure PHPS to open my php files in the browser in localhost. It's just opening them from the directory stored. Obviously I don't want to have to type localhost every time I want to process my files. I'm finding the manual not very clear on this issue.


Hi Steve,

Make sure you have configured at least one Deployment configuration (File | Settings | Deployment --- "Local" should do just fine) and marked it as default for this project.

Once properly configured you can right click on file in PhpStorm (Project View panel or Editor itself) and choose "Open in Browser ..." (the same via View | Open in Browser ...).

If you have configured browsers in PhpStorm (File | Settings | Web Browsers) then you can also use "View | Web Preview ..." (or hold the mouse still for a second and choose appropriate browser icon in small semi-transparent popup/hint box in right top corner  of the Editor window.


Hi Andriy,
Thanx for the prompt reply. I think I got it working after playing around with the settings. I set the connection type to "in place". And the rest of my settings look like the included screen shots. Let me know if I've missed something. I post the screen shots in case anyone else is trying to get this to work and doesn't know where to start. Thanx.


So now I've created a new project. How do I make that new project open in my browser? The only way I figured out how to do it is to change the default deployment to the new url, but that seems to defeat the point of having a default setting. Any help would be appreciated. What is the work flow for creating projects and being able to view them locally under xampp without having to manually type the address in the browser? This must be easy.



  • List of Deployments (and content of "Connection" tab ) is shared between all projects.
  • "Mappings", "Excluded" etc tab are per project -- they need to be configured for each project individually.
  • The "default" (4th button: +, -, copy, make default) is per project: this is for situations where you can deploy the same code to a few completely different servers.

I assume you have provided new settings in "Mappings" tab  in new project ("Local Path" and "Web Path") -- that is the correct way of doing it for your setup (when you access your projc via http://localhost/projectname/). Alternatively (when domain name is completely different: e.g. ) -- create new Deployment for this project only.


Thanx for the reply. I'm still stumped. I must be an idiot!?
I just want to see my project files in the browser. :) So, I create a new project. How do I let the ide know how to open these in the browser without having to type in the address manually? What are the exact steps? Half the time I don't even see the option to open in the browser from the menu, context menu or even the little icons in the corner. They just don't show. You assistance is much appreciated.


The only way I can make it work is if I
1) create a new project
2) settings > deployment > mapping tab
3) change the web path on server 'default': to the path of the folder in the xampp folder
4) and then I have to click on "use as default".

Surely it cannot be this complicated just to view my project files?! I must be doing something wrong.


Question from noob, after setting up a local server is not working menu "web preview". So conceived, or I did something wrong?


Hi Dmitry,

There must be something that you are still missing / setup incorrectly. To start -- please show your Deployment configuration (screenshots) -- make sure that all paths are correct (e.g. path or file is not outside of the project).


Please sign in to leave a comment.