How to View index.php in Browser

Hi, I am new to PHP Storm and am trying to get started with it.I create a new blank project, then add a php file called index.php.I then add one line of code echo phpinfo();.How do I prevew this in a browser?  The help file says to press alt F2, but this gives me the bookmark window.  I don't see the hover window that is supposed to be available.  I have set the browser in Settings/IDE/Browser.Is there something else I am supposed to do?Greg

Hi there,

Yes, it is Alt+F2 for preview functionality.

The help file says to press alt F2, but this gives me the bookmark window.

Seems you are using different keymap (Settings | Keymap).

Please check (and use) whataver shortcut you have assigned to "View | Prevew file in..."  (focus must be in Editor window (and not side tool windows) when menu is invoked).
Thank you very much.I have reset the keyboard to the Default key mappings, so now Alt+F2 maps correctly.However, the View | Preview menu is still greyed out when I try to preview.  I have made sure that the focus is in the editor window.Is there something else I need to do to Preview?

What version do you use?

As I understand it is 6.0.3.  If so :

  1. Try restarting IDE
  2. Create some html file -- see if this action will be available for that file (from what I see it's not always available for php files)

In any case: if you properly define Deployment entry ("In Place" type should be OK) and mark it as Default; then you will be able to use "View | Open in Browser..." on any file (default browser will be used)

Try upcoming v7 (EAP build available now) -- it has been reworked quite a bit in this area so it should work for php files as well

Thank you soooo much.  Have been struggling with this for days.  I downloaded the new version, and the menu is enabled on php files as well as html files.  The hover toolbar with the browser icons also shows and works.So I can click and see preview the PHP page now.Greg

Please sign in to leave a comment.