Phpstorm localhost gives 502 bad gateway, but interpreter set and xampp localhost is running fine.

Im having a weird problem. I just reinstalled windows and setup phpstorm. It keeps giving me 502 on my project. All settings are similar to my laptop running same network and working fine. Xampp server is ok and running on localhost, but phpstorms own webserver is not running. Any ideas how to fix this? 

Tried turning off and on windows firewall.. No success 


PhpStorm 2017.1
Build #PS-171.3780.104, built on March 21, 2017
JRE: 1.8.0_112-release-736-b13 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Comment actions Permalink

I tried doing like the last comment suggest and change ports in apache httpd.conf, but then I just get a 404 on my project. 

Comment actions Permalink

TBH I have no idea why would someone want to so that (to run their Apache on that port) -- why not use Apache from start and forget about built-in web server. At the end of the day -- your final code will extremely likely be running under Apache or Nginx in production... so why not use them from start?

You do have XAMPP already -- please use it -- it's better than built-in server anyway.

Comment actions Permalink

You might want to see how much memory your PHP script uses. I've just encountered this error and I've narrowed it down to it occuring when large amounts of memory are used in the page generation

Comment actions Permalink

I had that problem, but in my case the solution was quite simple...

I use the standalone version of the apache2 web server, and the path to it on my system is /usr/sbin/apache2:
$ which apache2

With that in hands, go to the PHPStorm and find this option:
File/Settings/Build, Execution, Deployment
PS: You can see this option in the first img that you have posted...

On that screen, click on the + button, give it a name and set the type of it, in my case is a localhost so i selected the "in place" option:

After that, set in the "Browse files on server" to the path to your project, in my case localhost/xcript/:

I setted this path because in my system i keep files in this path:

You just need to adjust this to your paths.
I hope that this helps you.

Comment actions Permalink

Same issue, even on fresh VM of Windows 10.

PhpStorm 2019.1
Build #PS-191.6183.95, built on March 27, 2019
Licensed to Marius Ene
Subscription is active until March 7, 2020
For educational use only.
JRE: 1.8.0_202-release-1483-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

Anyone else facing this issue? I have another Windows 7 machine which works fine.

Comment actions Permalink

Marius, are you using external web-server (like Apache) or PhpStorm built-in web server?

Comment actions Permalink

Hi Vasily, I am using the built in web server

Comment actions Permalink

With this release, 502 started to appear more often than it's used to be. Please vote for the issue:
I'll also ping the dev in a private comment.

Comment actions Permalink

Just to add some additional info, I've copied the default index php file from a fresh new composer project and seems that the failure is due to this method call:


Comment actions Permalink

the same error message with :

PHP 8.1.6 (cli) (built: May 11 2022 08:56:01) (NTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.6, Copyright (c) Zend Technologies

PhpStorm 2022.1.2

Build #PS-221.5787.33, built on June 1, 2022

Licensed to Seghir Issam
Subscription is active until July 3, 2022.
Evaluation purpose only.

Runtime version: 11.0.15+10-b2043.56 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

I use built in preview 

I find the problem with Material Theme , so I deactivate the theme and the preview work great !!



Please sign in to leave a comment.