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.

7 comments
Comment actions Permalink

Hello roman,

PHPStorm for some unknown reason, open Firefox, which is not my default browser (Chrome is) and puts this in the URL bar:


PhpStorm has own settings for default browser. See 'IDE Settings -> Web Browsers'.

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 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!

0
Comment actions Permalink

I have configured PHPStorm web settings correctly yesterday. I just double checked, same problem.

Here are screenshots.

http://www.mediafire.com/imgbnc.php/9e566e162c883d9b96cc44c39ff0d74cbff99971691c469ed1f2d0dc36f93e426g.jpghttp://www.mediafire.com/imgbnc.php/e5b9100027a9b4e2f06e1bb4501c0c665e39b093e39bc1b56351cdd6141902ee6g.jpg

And I went through both links you provided before I ever posted. So everything's working, except this URL problem and Firefox.

0
Comment actions Permalink

roman,

Thanks for screenshots.

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:


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.
create_a_new_run_configuration.png
remote_run_configurations.png


Thank you for feedback!

0
Comment actions Permalink

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

That's what I suspected. Thanks a lot Andriy.

The bookmarklet solution seems to be the best one.

Спасибо!

0
Comment actions Permalink

Andriy,

Thanks for the great answer!

0

Please sign in to leave a comment.