This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
4 Replies Last post: Feb 11, 2013 7:39 PM by Andriy Bazanov  
Andrew Leschinsky Newbie 7 posts since
Mar 30, 2012
Currently Being Moderated

Feb 11, 2013 3:30 AM

Problem with xdebug: Cannot evaluate / parse expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

I'm debugging web pages - and that works fine.

 

But when a page sends an AJAX request to the webserver (we're using AngularJS), I'm getting this:

 

Cannot accept external Xdebug connection: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

 

I  tried setting PHP_IDE_CONFIG to "serverName=mylocaldomain" - it doesn't  help. If I set it to just "mylocaldomain", I'm getting a different  error:

 

Cannot accept external Xdebug connection: Cannot parse the value of '$_SERVER['PHP_IDE_CONFIG']'

 

I tried all the different xdebug options suggested, it doesn't help.

 

I'm on Windows7, phpStorm 5.0.4.

 

Please help, I really need to be able to debug...

Andriy Bazanov Master 2,655 posts since
May 28, 2010

Hi Andrew,

 

1) Please provide some simple project to test (must be standalone -- includes all required files). This is what I have tried (jQuery library was used -- see attachment) and it works just fine here on Windows 7; IIS 7.5, PHP 5.4.11 (FastCGI), xdebug 2.2.1

 

2) If that does not work for you as well, then please provide your php.ini and xdebug settings (both from php.ini and output from phpinfo() ). Quite possible that it is your (environment?) configuration (not necessary xdebug/php only, but combination of web server (apache?) + php + xdebug).

 

Try capturing contents of $_SERVER array during such ajax request (not necessarily in debug mode) -- it may provide some hints.

Attachments:
Andriy Bazanov Master 2,655 posts since
May 28, 2010

Strangely enough, when I $.post() with jQuery, debugging works perfectly normal.

 

Maybe AngularJS sends different sets of headers.. that somehow affect xdebug? Never worked with AngularJS so have no clue.

Andriy Bazanov Master 2,655 posts since
May 28, 2010

I've tried this example from this site and it debugs here fine as well: http://www.cleverweb.nl/javascript/a-simple-search-with-angularjs-and-php/

Attachments:

More Like This

  • Retrieving data ...