Debugging: don't understand why I'm seeing localhost
I'm trying to debug a project on a Ubuntu server on my LAN. From the symptoms I assume I've got either the deployment or debug configuration wrong, but I can't see the problem.
When I access (through the browser, not debugging) "RemoteServer/RemoteProjectRoot/RemoteFilename.php" the output is what I expect.
The project within PhpStorm is at "c:\users\mikep\PhpstormProjects\LocalProjectName".
The Debug Configuration is based on the PHP Remote Debug Template, using RemoteServer as the server, with mapping from c:\users\mikep\PhpstormProjects\LocalProjectName to RemoteProjectRoot.
The Deployment configuration has "Visible only for this project" unchecked, Local or mounted folder, folder as W:\RemoteProjectRoot (W is mapped to the remote web server root) and Web Server URL "http:\\RemoteServer"
When I try to debug - following instructions - choosing the Debug Configuration, clicking Start Listening for PHP Debug Connections, clicking the PHP Remote Debug, then clicking the browser (Firefox), I see the following:
Browser opens tab for URL http://localhost:63342/LocalProjectName/RemoteFilename.php?_ijt=amivrr08krqronnjjp9ac84ntt and shows 502 Bad Gateway.
PhpStorm shows an error message with the latest error in the error log - "Remote PHP Interpreter is configured: Please select local PHP Interpreter to use built-in web server"
How did I get this, and how do I fix it?
Thanks
请先登录再写评论。
localhost:63342 means that you're opening the project via built-in web server. I believe you want to debug the project that is running/staged on a remote web server?
You need to set up correct deployment and mark it as default in deployment settings (a "checkmark" next to "+" and "-" buttons in deployment servers list). It would be the W:\RemoteProjectRoot" one per your explanation.
Just FYI we have a set of debugging guides available: https://www.jetbrains.com/phpstorm/documentation/debugging/
Thanks Dmitry. I have read many of the guides and tried lots of approaches that continue to confuse me, as well as read lots of forum comments and tried to apply suggestions.
I have managed to make some progress through setting a default server for deployment.
There are some things I keep running into that make it difficult for me as someone who is not deeply immersed in development every day, or for long stretches.Those who are spending much of their time on development may not see the same issues - or have worked through them enough to not be dragged down..
The general issues include changes that don't seem to stick, and defaults that don't really seem to be defaults, plus settings that vary depending on how you get to the same page (which may be a variation on the other things). I can't describe all of these in detail because it would take too long, and PhpStorm seems to be a moving target as far as documentation synched to the product version. But one thing continues to stand out:
If I start debugging - click the green debug icon - an Edit configuration window shows up (there is probably some reason why it's showing up every time). If I click Debug or Cancel, then the browser button, I can start debugging. But if I click Validate debug configuration on the web server (because I want to confirm settings), the window shows the settings for Local Web Server or Shared Folder. If I click Cancel it's OK. But what's shown makes me think that the configuration is messed up so I sometimes validate again - at least until I've gone through the process a few times. It's just one more thing that takes me away from what I'm trying to do - develop and debug.
I realize that PhpStorm has a tremendous set of capabilities, and that you are trying to serve the needs of different use cases. But there is a lot of frustration coming up to speed again every time I want to use it.
Mike
I should also mention that messages appearing in various places - such as path mapping changes or "deployed file on 'project'" is removed - don't seem to go away when the activity has been completed, suggesting that the change did not happen.