PHP Storm Insists on using localhost to run php scripts

I am attempting to move from phpED to phpStorm.  Today is my first day withPHPStorm.

I have read and read the documentation but I'm at a loss.  I understand that my project files must be stored locally and that they should be a mirror of what is on my server.  PHPStorm should update the server files when I make a change in the project files. That doesn't happen.  The only way I can update them is to right click and select "Upload To" 

The  server is on my local network and the folder with the website files maps to drive w:  

When I launch the website http://www.myname.local from Chrome it works just as it should. 

However, when I try to run any of the files from phpStorm, it insists on trying to run them in localhost.

Under Deployment->options->mapping the project URL is correct.

 

So, my problems are...

  1. keeping remote (network share) files in sync with project files
  2. configuring phpstorm to launch www.myname.local when I click on run.

I need some help.  I know that getting started is quite a learning curve but I love the editor and want to stick with PHPStorm if at all possible.

Thanks,

Dave

 

3 comments

Hi there,

Need more details. But right now I may offer this link in case if you have not seen it yet: https://confluence.jetbrains.com/display/PhpStorm/Deployments+in+PhpStorm

Please provide screenshots of your Deployment entry (all 3 tabs, just in case; but mainly interested in 1st one) -- this is to see the URL used etc.

Then provide screenshot of your Deployment options (Settings/Preferences | Build, Execution, Deployment | Deployment | Options) -- this is to check for automatic deployment options.

  • How many deployment entries do you have?
  • Is it checked as "Default"?

>However, when I try to run any of the files from phpStorm, it insists on trying to run them in localhost.

What do you click to run the? if it's Run/Debug configuration .. then then URL should already be saved in it ... so you will need to delete it first.

>The  server is on my local network and the folder with the website files maps to drive w:

So you have opened your project using that path? In other words -- it reads directly from the network disk? Or you have made a local copy (on your local HDD/SSD)?

1

Here are the screenshots

"Then provide screenshot of your Deployment options (Settings/Preferences | Build, Execution, Deployment | Deployment | Options) -- this is to check for automatic deployment options."  

Note that the following screenshot indicates that a default server is not configured.  On the deployment connection page, I list two servers, BM Scheduling is my local server, VSHXXAAI is the deployment server.  I have clicked the green checkmark several times and clicked the "Use this server as default" button on the Mappings page but apparently to no avail.

   At present I am not concerned with the deployment server, only the local testing server.

"So you have opened your project using that path? In other words -- it reads directly from the network disk? Or you have made a local copy (on your local HDD/SSD)?"

There is a local (SSD C: drive) copy and a copy on the server.  Saving to the local copy does not also save to the remote copy.  The only way I can get it to update is by right clicking in the local file and then selecting "Upload To".

To run the file , I use  Shift F10.  When I do so, PHPStorm loads the following into Chrome's address bar:

http://localhost:63342/BM%20Scheduling/index.php?_ijt=3hqgns1fm9cug34nr6fnnquh8e

I hope I've provided all of the information you've requested.  I appreciate your help.

Dave Davis

 

0

>Note that the following screenshot indicates that a default server is not configured.  On the deployment connection page, I list two servers, BM Scheduling is my local server, VSHXXAAI is the deployment server.  I have clicked the green checkmark several times and clicked the "Use this server as default" button on the Mappings page but apparently to no avail.

You have possibly clicked too many times -- it acts like check box -- on and off.

It's hard to say from your screenshot in what status it is (especially since I use light (Windows) GUI theme) .. but it does not look like it's marked as Default -- your words/screenshot with warning + default entry should use bolder font in that list.

So -- try to click it (make Default) button one more time.

 

>I list two servers, BM Scheduling is my local server, VSHXXAAI is the deployment server.

They both Deployment entries from IDE point of view: just one copies files via locally accessible file path while another does it over FTP.

 

>To run the file , I use  Shift F10.  When I do so, PHPStorm loads the following into Chrome's address bar:

As I have suspected --- Shift+F10 is bound to "Run | Run XXX" which will run currently active Run/Debug Configuration entry. The URL must have been saved there from the first time (when that entry was created) .. or it just uses PhpStorm's built-in simple web server as no Default URL is given (since you still do not have Default deployment entry).

 

I suggest setting up Default deployment first ... then go to "Run | Edit Configuration" and delete those unwanted/old entries .. or adjust URLs manually to match desired ones.

1

Please sign in to leave a comment.