How Do I configure PHPStorm (Mac) so that I can view pages in a browser?

Hi,

  Is there a guide that shows how to configure PHPStorm on Mac so that I can click the 'Play' button and have my current page displayed in the browser?

  I attempted this, but when I click the green Play arrow, it's brining up safari in the root of my site, and not in the page I have open in the editor.

  Thanks,

  - Jack

0
2 comments

Hello Jack,

First, let me bring up the terms a bit: Run (aka 'Play') button actually starts the selected run configuration. Run configuration is basically a couple of settings (files paths, parameters and so on) that define what should happen when you click Run or Debug (many run configurations may be started in debug mode - including PHP one, when you're going step by step over each PHP instuction as the server executes it).

Likely you have a run configuration that points to a certain page (server root). You can check this by clicking on a dropdown at the left of the Run button and clicking 'Edit configurations'. So to have different page opened, you need a different run configuration. Fortunately, creating it is as easy as right-clicking in editor and choosing Run -> 'filename.php on servername'. There's also a hotkey for this: shift+option+R.

Regards,
Kirill

0

Thanks For the reply!

  I found and got the php debugging configured, it wasn't hard but it didn't work without some tweaking to my MAMP Configuration.

  I had also emailed support about this same issue and found out that a right click in the editor - >Open in Browser produced the results I was looking for.

  Note to other readers - if you're coming from a text editor such as CODA and you're just looking for a quick way to preview the current page in the browser without any setup, right click and choose open in browser.

  Thanks to Kirill and Serge @ JebBrains - your support is top notch.

  - Jack

0

Please sign in to leave a comment.