Running Individual files on remote server with PHPStorm

I have a standalone server that I use only for php development.  It is on a 1GB network ad as such is plenty fast for me.  My script files reside on that server.

I have a development website such as www.develop.local running on that local server.  I am able to easily configure phpstorm to run http://www.develop.local

but I cannot figure out how to configure it, for instance, to run an individual script such as http://www.develop.local/dog/dog.php.

When I type http://www.develop.local/dog/dog.php into the browser address bar, it runs fine.  I simply need to be able to configure php storm to run the current file in the editor.

I would also like to say the error indications, which I believe you call inspectors run plenty fast with my source files on the 1GB network.  It would seem to me that this would be a common development environment for individual developers and one that you should support.

Thanks,

Dave Davis

 

 

0
7 comments

Hi there,

Define the Deployment entry ("In Place" type will do for you .. so no file movement will happen) and mark is as Default for this project -- IDE will take base URL from there if needed.

Another way: create Run/Debug Configuration of appropriate type and use it to run/debug specific page -- full URL can be defined there.

0

Your suggestion seemed to work with phpstorm 17

However, I have now upgraded to phpStorm 2018.1.2 and I can no longer run php scripts. It does seem to open HTML files okay. 

When I attempt to run a php script I get a dialog - Edit Configuration - that wants me to "Fix" php home.

I can run www.bmsched.local just fime.  I simply want to run www.bmsched.local/customers/customer.php as a stand alone file. 

THanks,

Dave Davis

 

0

>When I attempt to run a php script I get a dialog - Edit Configuration - that wants me to "Fix" php home.

I see nothing wrong on provided part of screenshot. Does it has any warnings below on the same tab .. or maybe something on "Mappings" tab?

The "error" from the message does not suggest much for me ... at very least it's unlikely to be related to the posted screen -- must be some  another one. If you cold show the actual message .. and show what buttons do you click etc... So far it sounds like it tries to use PhpStorm's built-in simple web server (URL will be like localhost:63342/PROJECT_NAME.path/to/file.php) .. which requires proper PHP Interpreter defined to serve PHP code. If it used to work before -- maybe try re-defining your deployment server as default for this project once more...

 

 

In any case: To just open some predefined URL from within the IDE you may create Run/Debug configuration of "PHP Web Page" type and provide the info there.

You can then select it in drop down box and click on "Run" button (or shortcut) regardless of the currently active file.

Since this kind of configuration also supports debugging .. you will need to define "PHP | Server" entry (domain name + port basically) ... It's accessible from that screen by clicking on appropriate "..." button (or full path via "Settings/Preferences | Languages & Frameworks | PHP | Servers")

At the same time ...  Since you just want to open some URL in the browser ... the Run/Debug Configuration of "JavaScript Debug" might also be used here -- you can define FULL URL there with no need for additional servers setup anywhere else.

 

0

Here are the deployment screens.  They see the project URL correctly

 

 

But when I try to run a script, I get this dialog

 

Also note that my run/debug dialog under configuration asks for a filename and arguments; whereas yours asks for a server and a start url

Once again I appreciate your help.

Dave

0

This is "PHP Script" type of Run/Debug Configuration. It's meant for executing particular script in CLI environment and not via browser. You need properly defined and accessible PHP Interpreter in order to use this.

0

But that is a not what I want to do.  I simply want to be able to run an individual script file.  If I am editing a file, I want to quickly be able to see it.

So, if my root url is www.bmsched.local, I want to be able to run www.bmsched.local/dog/puppy.php.

This must be a common thing.  Something in my configuration must be wrong,

Thanks.

0

>But that is a not what I want to do.

Exactly. I do not know why you have created those ones or insist on using them.

 

>I simply want to be able to run an individual script file.

And I gave you the ways of how it can be done -- to open specific URL in one click via "PHP Web Page" type of Run/Debug Configuration.

Why cannot you use it? Any specific reason?

 

Here is another idea (which I assume you already know based on what you wrote): right click and use "Open in Browser"

0

Please sign in to leave a comment.