Viewing pages in External Browser

Ok, I really did have this working before.  My laptop had to be replaced and so now I am running on Lion.  I have had to setup PHPStorm again.

I can get debugging to work.  I can display output inside the IDE, but I don't have the right click option to display the page on my localhost server (the one that comes with the OS and who's webserver folder is: ~/Sites ie: /Users/john/Sites)

I can load the page in a subfolder by typing out the entire URL ex: localhost/~john/sandbox/phpinfo.php
I can right click with the file open and say run phpinfo.php and it will display output inside the IDE

It must be something simple but the docs are not giving me what I need and I forget how I did it before.

Of course I will add whatever details in a reply you might need to answer my question.

Thanks for your assistance,

-John

10 comments
Comment actions Permalink

Hi John,

Make sure that you have setup Deployment entry (Settings | Deployment) and marked it as Default -- data from there (local path and URL) will be used for assembling final URL and opening it in browser.

Once done -- you should be able to open current file in browser via "View | Web Preview..." action, or "View | Open in Browser FILENAME on DEPLOYMENT" (or via browser icons, which would usually pop up in semi-transparent window in Editor area, top right corner). List of available browsers can be configured in "Settings | Web Browsers".

Another way to open predefined URL  is to create Run Configuration of "PHP Application" type (Run | Edit Configurations)

0
Comment actions Permalink

Thanks for your reply.

I think I have it setup in deployments as you have suggested.

For the suggestion: "View | Web Preview" is grayed out.

Does that indicate what I might have nor configuered correctly?

I also don't have the "right click option to display the page on my localhost server" like I did before.  I could be in any open file and just run with the external browser.  Hmmmmm....

Thanks,

-John

0
Comment actions Permalink

For the suggestion: "View | Web Preview" is grayed out.

Does that indicate what I might have nor configuered correctly?

It's disabled here if I disable all browsers in "Settings | Web Browsers". Have not checked with improperly configured deployment though.

I also don't have the "right click option to display the page on my localhost server" like I did before.  I could be in any open file and just run with the external browser.  Hmmmmm....

Don't know -- I'm not using such functionality anyway (for few reasons -- one of the project structure + all URLs used are "nice URLs" -- e.g. "/help/delivery" instead of "/help_delivery.php" etc ), so cannot say why it is no longer available via right click.

I think I have it setup in deployments as you have suggested.

Well ... please show your settings, what is the project URL, local path to the project and what file you are trying to open.

0
Comment actions Permalink

Settings:

On a mac and using my localhost webserver that ships with MAC Lion.

Real path is /Users/john/Sites/sandbox
File in that folder is: phpinfo.php

Deployment settings are:

Name: Localhost (Could name this anything of course)
Connection: In place
Webserver root URL: http://localhost/~john/sandbox
Mappings: Localpath is:  /Users/john/Sites/sandbox
Web path is: http://localhost/~john/sandbox

No excluded paths

Settings-1.png
Settings-2.png

Settings-3.png


Thanks,

-John

0
Comment actions Permalink

Hi John,

"Mappings" tab -- Web path on Server. The proper path for you should be just "/" (without quotes, obviously) as it is a relative path to the one provided on "Connection" tab.

Apart of that -- the rest looks OK and Web Preview should work. Does "View | Open in Browser FILENAME on DEPLOYMENT" works or not?

P.S.
Your start URL (actually final URL below it) for 3rd image (PHP Web Application run configuration) looks odd -- it has no "/sandbox" in it (compared to the paths and other images you've provided).

0
Comment actions Permalink

Hi,

I made the one change to fix the "odd url".

For the comment: "Does "View | Open in Browser FILENAME on DEPLOYMENT" works or not?"

No, it is gray!
So is Web preview.

setting-4.png
I was able to restore a project folder from the previous computer and when I lod it, I can get a right click screen in the opened file window that include the item circled in red.  I like having this ability a lot!

setting-5.png
I am trying to figure out what is different, but this is one of the goals.

Having the other right click context menus would be super as well :)

Thanks,

-John

0
Comment actions Permalink

Your images are very low quality, and it's hard to tell if the deployment option is marked as Default or not -- it is important for this functionality. Maybe that is the case?

0
Comment actions Permalink

Hmmm...  I can read them fine :) I'm on a Retina display :)

Sorry, I know you are trying to help and I appreciate it.
Ok, where you say "..it's hard to tell if the deployment option is marked as Default or not..."

Could you please be a little more specific as to what and where you mean.

Thanks,

-John

0
Comment actions Permalink

Maybe it's fine on retina but here on normal screen it looks bad (looks like very limited number of colors is used).

I'm referring to your first 2 images (Settings | Deployment) -- is your "localhost" deployment marked as Default ?

0
Comment actions Permalink

Quote: "

Maybe it's fine on retina but here on normal screen it looks bad (looks like very limited number of colors is used).

I'm referring to your first 2 images (Settings | Deployment) -- is your "localhost" deployment marked as Default ?"

Ah yes, those eariler ones DO look aweful.  I was just trying to meet the upload requirements.  I think I'm getting better at it though with the later images?

But yeah, anyway, tapping that button did make the right click option appear and now I can just view the page in my browser.  Cool!

I will update this if I have more questions from here.

I DO appreciate your patient assistance.

Regards,

-John

0

Please sign in to leave a comment.