Can't get config right on Windows

Hello,

I am evaluating PHP Storm 3.0. And I am trying to get all aspects to work correctly with respect to PHP.
Especially when I try to opn in a web browser and that item is grayed out.

So I have a XAMPP install on my local machine.  The path to it is:

C:\xampp

and below that I have the htdocs folder ( where all php files go )

So say I want to have this:  Also FirstProject folder does not exist

C:\xampp\htdocs\FirstProject

Assume PHP Storm is a clean install and nothing is configured other than
it being able to launch running WIN 7. Also assume I have this PHP code
that I want to run inside Firefox:

<html>
<body>
<?php
echo "Hello World";
?>
</body>
</html>

What are the steps to do so? I have given the first two below:
1. Launch PHP Storm
2. Under Quick Start click on, "Create New Project"
3. ?
4. ?


After all of this is done I should be able to use the "Open in browser" as well.


Thanks,
Jim

6 comments
Comment actions Permalink

Maybe I answered my own question.  Open in web browser is only
avail if the file type is htm or html. Meaning you can never open
in a web browser for a php file?

T or F?

Jim

0
Comment actions Permalink

Hi Jim,

In order to use "execute php in browser" (View | Web Preview...) you need to create and properly configure Deployment entry (Settings | Deployment) and mark such entry as default for that project. That is required so PhpStorm knows what URL to open (simply speaking: which URL represents which file in your project).

You can:

  1. create your project directly at destination (C:\xampp\htdocs\FirstProject) and then use "In Place" Deployment entry type.
  2. create your project elsewhere (e.g. C:\Projects\FirstProject) and then use "Local or Mounted folder" Deployment type to automatically copy project files from there to web-accessible folder (C:\xampp\htdocs\FirstProject). With this option it is very useful to use "Settings | Deployment | Options | Upload changed files automatically to the default server" to make such copy operation executed right after file was saved in PhpStorm.


P.S.
You can create project folder in advance (watever location you want) and then use "File | New Project from existing files..." (wizard-based, will help you setting up Deployment etc) or even "File | Open Directory" (all post-configuration is done manually).

0
Comment actions Permalink


Thanks for the reply Andriy. But I still can't get it to work right. I
can run the PHP script and get the output
at the bottom of your app. The only way to see the actual web page in
FireFox is to manually
have that page open always and do a refresh on it. Let me mess with this
more. We both know
this config issue should be a no-brainer but i am struggling with it.

Jim

0
Comment actions Permalink
I can run the PHP script and get the output at the bottom of your app.

That's Run/Debug Configuration ...

You can create one using "Run | Edit Confgurations" (or the same in dropdown box on main toolbar) -- use "PHP Web Application" (or even "PHP Remote Debug" -- but that's debug-only) type (check Help to see what the difference is -- mainly how debugging is triggered).

0
Comment actions Permalink

Hello Andriy,

I think the best advice you gave is to start with a blank folder say testproject below htdocs  and then
use the wizard found at "create project based on existing files". Then go back and see how each value  is set
by going to File -> Settings . The wizard for the most part works. The reason I say this is because I just installed
the Zend Community Edition Server  (localhost on  port 85 ) and when I ran the PHP Storm Wizard there was no option to change the local
port to 85. But I figured I could go into the Settings in PHPStorm and change it later, which worked.

Thanks,
Jim

0

Please sign in to leave a comment.