PHPstorm 10.0.3 Error 502 Bad Gateway (Due to JavaVM?)

You are using PhpStorm's own built-in web server, which has some issues right now (especially with POST requests, e.g. WEB-17317).

The solution is to use your own proper web server (Apache/IIS/nginx/whatever).

  1. Define Deployment entry. In place type should be fine, as long as your Apache/IIS can serve files from that location; otherwise either configure web server to be able to do that .. or use another type of deployment (e.g. Local or Mounted Folders for IDE to copy files to another location for you)
  2. Configure it (provide desired URL etc)
  3. Mark it as Default for this project

Now IDE will use that base URL when you will use Open in Browser or Run/Debug actions (NOTE: it will not affect any existing Run/Debug Configurations -- only future ones; you will have to update your current Run/Debug Configurations manually).


This is what worked for me.

I opened XAMPP control panel v3.2.2, I went into Apache->Config->httpd.conf and changed the below code

Listen 12.34.56.78:80

Listen 80

to

Listen 12.34.56.78:8080

Listen 8080

Also, ServerName localhost:80

to ServerName localhost:8080

saved the file httpd.conf and then started the apache below action from the main screen of XAMPP Control Panel v3.2.2 and it started the apache.

After that I opened the browser and MANUALLY typed the address for example:

If previous address was: http:// localhost:63342/htdocs/template.php (no space inbetween)

the new one would be:http:// localhost:8080/template.php (no space inbetween)

It should run just fine. Refresh the page and you shouldn't get 502 Bad Gateway error.

Remember: If you run your application later it may go back to previous location, All you need to do is, use the new location on address bar which would be (in this case) http:// localhost:8080/template.php. (no space inbetween) In your case: http:// localhost:8080/yourfilename.php (no space inbetween)