6 Replies Last post: Apr 3, 2012 3:19 PM by John McBade  
John McBade Newbie 46 posts since
Mar 31, 2012
Currently Being Moderated

Mar 31, 2012 5:36 PM

Setup instructions are not working for me

I am tryng this product out on a trail evaluation.  I wanted to like this IDE as it has so many great reviews.  So far, I find it very frustraing to setup.

 

I am running on Snow Leopard, using localhost.  I have xdebug installed as I can use it fine with other IDEs.

 

I have tried walking through the pages found on:

 

Several useful links about Xdebug and PhpStorm:

http://blogs.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/

http://confluence.jetbrains.net/display/WI/Documentation

 

I did get it to actually run sorta of once, but I have NO IDEA what I did to get it sorta working that one time.

 

Three things that are glaring issues:

 

1) Not stopping on any breakpoints, just rendering the page as though I had only asked to display in the browser.  I hit the little listening icon, I get a "connected" in the variable window of the IDE, but nothing but the Console spitting out "Error in parsing value for 'filter'.  Declaration dropped." over and over.

2) (When it seemed to work this one time) It's debugging all this JavaScript stuff ?  What if I just want to debug a simple PHP environment?

3) In the http://blogs.jetbrains.com/webide/2011/03/configure-php-debugging-in-phpstorm-2-0/ walkthrough, not all the modes exist in version 3.x of this IDE, and it's "fuzzy" still how the modes work and in what use cases.

 

Other IDEs seem a lot easier to setup so far.

 

It seems a straight forward "getting started exists for this IDE", or, it's that something everyone is missing is just not being made clear.  Need a very straightforward setup walkthrough for a local environment maybe?  I donno....

 

Again, I WANT to like this IDE but I am really frustrated so far.  I hope I have given enough clues to pinpoint where my frustration lies, and you will be able to spot this right off.

 

Thanks,

 

-John

Gary Mort Newbie 53 posts since
Sep 22, 2011
Currently Being Moderated
Apr 1, 2012 7:12 PM in response to: John McBade
Re: Setup instructions are not working for me

[quote]

1) Not stopping on any breakpoints, just rendering the page as though I had only asked to display in the browser.  I hit the little listening icon, I get a "connected" in the variable window of the IDE, but nothing but the Console spitting out "Error in parsing value for 'filter'.  Declaration dropped." over and over.

[/quote]

 

XDEbug has always been a pain to setup for me for all IDE's.  To break it down, keep in mind how XDEbug works.

 

You start the IDE listening on port 9000.

The page is loaded on the web server. 

1)XDebug checks for the existence of a magic cookie that tells it to debug the page. 

2)XDebug attempt to connect to port 9000 of the debugging client

3)XDebug sends positioning information to the client[I am on line 1 of /var/www/mytestsite/index.php]

4)The client must figure out that /var/www/mytestsite/index.php is stored locally as /projects/mytestproject/website/index.php

5)The client sends all the breakpoints currently configured up to the server, translating paths as needed.  IE "stop at line 50 on /projects/mytesproject/website/library/buggylibrary.php" but on the server it is /var/www/mytestsite/library/buggylibrary.php

 

Lots of potential problems here.

1a) Is the magic cookie that xdebug is looking for the one that your sending?

1b Do you have any security enabled on xdebug so that only connections from localhost will have the magic cookie honored

2a) XDebug can be configured in many different ways for connecting back to the client - it can connect to the same ip address which connected to it, it can connect to a specific address, it can connect to only addresses in a specific set, etc

2b) Is your IDE listening on the right port

4a) Is your mapping setup properly? 

 

This is exaceberated by the fact that the default behaviour for XDebug changes from version to version.   Because of this, I tend to avoid the "zero" configuration and go through and set all my options.  Don't trust the defaults.

I also find it helpful in the beginning to configure PHPStorm's IDE setting to always break on the first line. 

 

From your error message above[error in parsing value for 'filter'] - it would seem that your problem is part 4.  PHPSTorm is sending the wrong full path for the file to server.  So the server rejects it[file /var/www/projects/mytestsite/mytestproject/website/library/buggylibrary.php does not exist, for example.] and then since there are zero breakpoints set, it just runs through to the end.

 

Lastly, one thing I find confusing with debugging is that you have to reverse your server/client thinking.

 

The Web SERVER is running the php application.

PHP XDEBUG is running an xdebug CLIENT to connect to your IDE!

YOU are running an xdebug SERVER to process the connections.

 

So when XDEBUG talks about a 'server' it means the IDE NOT the web server!

 

Now the bad news...  I can't help past that as at the moment I failed in my last attempt to get XDebug to work.   The good news though is that after all the frustration with the above, I have decided the next time I try to get things setup I plan on installing and using DBGProxy - and that PHPSTorm supports it.  The main problem I have with troubleshooting is trying to figure out what the heck is going on.  Trying to parse through the console messages AND the xdebug logfiles[assuming I even got the permissions correct on the directory I wanted to create a logfile in!] is a real pain.

See http://derickrethans.nl/debugging-with-multiple-users.html for details on dbgproxy.

 

DBGProxy takes a lot of pain out of configuration and gives you a lot more options.  Now the process becomes:

The page is loaded on the web server. 

1)XDebug checks for the existence of a magic cookie that tells it to debug the page.   Included in that magic cookie is the "idekey" - a unique string to identify you[your name plus the name of the ide seems like a good choice!]

2)XDebug connects to the DBGProxy at the ip address and port number you configured.  It ALWAYS uses the same one!

3)DBGProxy uses the idekey to identify which user to send the traffic too.

 

Note, pre-setup for this on the IDE consisted of:

1) Configure your idekey

2) Start 'listening' for connections, which really means

2a) The IDE connects to the DBGProxy

2b) The IDE identifies itself by the configured idekey

 

So DBGProxy matches 2 client connections by idekey and ties them together

 

Even better, you can configure DBGProxy to LOG EVERYTHING and now you can find ALL communications mismatches by checking a single logfile!

 

DBGProxy adds even more functionality if you have multiple developers, as they can all use the same proxy.  It also works great if your running multiple LANGUAGES.  For example, let's say in the middle of your PHP application, you call an exec to run a python utility.   Python has it's own remote debugging tools and it also can use DBGProxy as the middleman.  So when it comes to the exec point - if you make sure to include the ide key for your python ide - and the python ide is running and connected - then when the python script starts, you can switch over to the python IDE and debug that also!

 

[quote]

2) (When it seemed to work this one time) It's debugging all this JavaScript stuff ?  What if I just want to debug a simple PHP environment?

[/quote]

 

Both chrome and firefox ALSO support remote debugging for web page loading.  So when THEY start loading a page they will connect to an IDE and as they process the incoming html and javascript you can step through your code.  PHPStorm can act as a remote debugger for them ALSO!  Unfortunately the "debug" buttons on the toolbar lack labels, so I found myself frequently hitting the WRONG button.

More Like This

  • Retrieving data ...