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

10 comments
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. 

0
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.

0
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

0
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
/usr/sbin/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.



2
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.

1
Comment actions Permalink

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

0
Comment actions Permalink

Hi Vasily, I am using the built in web server

0
Comment actions Permalink

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

0
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:

$response->send();

0

Please sign in to leave a comment.