PHPStorm won't point to the right page during debugging. Help!
Hello,
I'm evaluating PHPStorm and I like it so far, I'm also using your ReSharper for VS, which is why I decided to try PHPStorm.
I run WAMP on my machine for local testing and development. I have managed to configure debugging in PHPStorm with xdebug, which was no small feat. But now, I have another problem with debugging.
When I want to debug a PHP page, normally, in PHPEd for example, you can right click on a file and select 'Debug', PHPStorm has a similar feature, however any time I right click on some PHP file in my web project and try to debug the page, PHPStorm for some unknown reason, open Firefox, which is not my default browser (Chrome is) and puts this in the URL bar:
'http://localhost/php_coding/http://localhost/php_coding/vieworders.php', which brings up a Forbidden message from my Apache server.
If I simply hit debug from the main menu while selecting the main server, it opens correctly in Chrome with the URL.
'http://localhost/php_coding/?XDEBUG_SESSION_START=18045', etc, which works if I put the page name I want to debug before the ?XDEBUG_SESSION_START command.
But any other page selected in the drop down list to the left of the green debug and run arrows, opens up Firefox with the wrong URL.
Please help, thanks.
Please sign in to leave a comment.
Hello roman,
PhpStorm has own settings for default browser. See 'IDE Settings -> Web Browsers'.
Please provide screenshot of at least one problem configuration.
Also, I am sure that these blogpost about debugging in PhpStorm might be useful:
http://blogs.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/
http://blogs.jetbrains.com/webide/2011/02/zero-configuration-debugging-with-xdebug-and-phpstorm-2-0/
Thank you for feedback!
I have configured PHPStorm web settings correctly yesterday. I just double checked, same problem.
Here are screenshots.
And I went through both links you provided before I ever posted. So everything's working, except this URL problem and Firefox.
roman,
Thanks for screenshots.
The 'Debug' context menu item is about javascript(local and remote) and php local script debugging. Debugging of PHP running on server allowed through custom 'run configurations' only.
Thank you for feedback!
Thank Nik,
But, I still have a problem. I figured out that PHPStorm only has the JavaScript debug option when you right click on the file in the Project list view. I had PHP Application configured and it works fine, but again the problem is that when I run it, it opens to the default index.php page and not the page I currently put breakpoints on, like vieworder.php for example which is part of the web site and so when I hit Debug and I'm workin with that file, that's the file I want to be debugged and not the root file. Is there a way to do that?
Else, I have to change the URL every time manually.
When you setup Run/Debug Configuration it is for that specific page only. If you want for another url/page you have few options:
1) create the same (use Clone/Copy functionality) for that specific page/url and use it -- not so convenient as you still have to do this for every page you want to debug
2) use single Run/Debug Configuration (home page, for example) and then just navigate to the page you need -- very inconvenient
3) Turn Listening mode ON (so PhpStorm debugger is always ON) and control Xdebug via bookmarklet or browser plugin/extesnion -- I find this very convenient -- my personal preference. -- http://confluence.jetbrains.net/display/WI/Zero-Configuration+debugging+with+PhpStorm+2.0
That's what I suspected. Thanks a lot Andriy.
The bookmarklet solution seems to be the best one.
Спасибо!
Andriy,
Thanks for the great answer!