502: Bad Gateway when running Debug (new installation)

I just installed PhpStorm following the directions here (although the instructions are not up to date with regard to Integrating MAMP with the IDE), so I decided to proceed and see what happens.  I have some code in a project named viewCart with one file (viewCart.php).  When I click on Run I get this error:  502 Bad Gateway - PhpStorm 9.0 and this popup in my project source code:



So I click on configuredPHP Interpreter, and this is what pops up:



I haven't a clue what goes in the include path (the PhpStorm instructions don't mention this that I could find)...

So how do I get PhpStorm to run my small app in Debug mode?

8 comments
Comment actions Permalink

Sorry, images are lost...Please can you re-send them?

0
Comment actions Permalink

I just installed PhpStorm following the directions here (although the instructions are not up to date with regard to Integrating MAMP with the IDE), so I decided to proceed and see what happens.  I have some code in a project named viewCart with one file (viewCart.php).  When I click on Run I get this error:   502 Bad Gateway - PhpStorm 9.0 (this is the URL:   http://localhost:63342/viewCart/viewCart.php) and this popup in my  project source code:

Screen Shot 2015-07-24 at 10.05.40 AM.png

So I click on configuredPHP Interpreter, and this is what pops up:

Screen Shot 2015-07-24 at 11.17.54 AM.png

I haven't a clue what goes in the include path (the PhpStorm instructions don't mention this that I could find)...

So how do I get PhpStorm to run my small app in Debug mode?

0
Comment actions Permalink
this is the URL:   http://localhost:63342/viewCart/viewCart.php

This URL tells that you are not using your MAMP (Apache as web server in particular) but PhpStorm's simple built-in web server.

I just installed PhpStorm following the directions here (although the instructions are not up to date with regard to Integrating MAMP with the IDE)

Yes, settings/preferences path is a bit different but overall procedure is still the same.

You need to create & configure Deployment entry (just use search box in top left corner) with correct settings and mark it as Default for this project. Now IDE will use your MAMP's URL which you provided there to serve your web pages.

0
Comment actions Permalink

OK... under Deployment, what is "Deployment path on server 'Apache' look like?  (relative to folder '/Users/Rolf/Documents)

And thanks for your quick replies; I really appreciate it... :D

0
Comment actions Permalink

Usually it's just "/" (that's usually the case when using FTP deployment or when you have separate domain for accessing your website in a browser instead of "localhost").

(relative to folder '/Users/Rolf/Documents)

I do not think it should be that folder. I think it should be the path similar to what you see in the actual article (e.g. relative to "/Applications/MAMP/htdocs"). Unless, of course, you configure your Apache to serve files directly from current project location (e.g. using symlink).

Unfortunately I'm not a Mac/MAMP user and unable to give you any specific/better info.

You can read more about deployments here: https://confluence.jetbrains.com/display/PhpStorm/Deployments+in+PhpStorm -- may help understanding how it works better.

Since I have no clue how well you know MAMP and how Apache works ... my suggestion is:

  • first configure your MAMP/Apache so you can browse your site (any simple file to start with) in a browser
  • once this done -- it will be easier for you to see how deployment works/what paths to use to copy files in right location (or if any copying will be required).
0
Comment actions Permalink

Thank you... the '/' got me past the error... I have another question:  why is it that PhpStorm uses Google Chrome and not my default browser (Firefox)?

0
Comment actions Permalink

... because you (possibly) clicking wrong buttons/menu items..?

Right now it sounds like you are doing JavaScript debug/run .. and not PHP.

0
Comment actions Permalink

Point your PHP executable in PHPStorm configuration to your MAMP php-cgi executable, mostly likely found here:  applications/MAMP/bin/php/php7.0.13/bin/php-cgi.  

https://www.youtube.com/watch?v=EsLF9XJMKj4 unfortunately google puts an ad at the beginning, but you can skip it in a few seconds. 

 

 

0

Please sign in to leave a comment.