Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])' - When Debugging

Everything I find on this topic is related to CLI debugging, I am not doing CLI debugging.

When I attempt to debug PHP I get the following error message in PHPStorm:
Cannot accept external Xdebug connection: Cannot evaluate expression 'isset($_SERVER['PHP_IDE_CONFIG'])'

I am on Win 7 with Version 4.0.2 of PHPStorm.

I assume I just have something configured incorrectly, but I have tried everything to fix it with no luck, and "the google" hasn't returned anything very helpful with this issue.

Thanks!
Mike

0
33 comments

Hi Mike,

You need to provide much more information: screenshots of your PhpStorm debugging settings; how you launch debugging etc -- maybe (just maybe) you are doing something wrong (e.g. in configuration or when initiating debug mode).

P.S.
Some simple screencast is much better than static screenshots or just plain text.

0
Avatar
Permanently deleted user

Thanks for the response!

I have attached a screenshot of my settings.

I am trying to use xdebug. The php code sits on another machine than PHPStorm so I am making the remote connection.

I have all the xdebug setting configured correctly(as far as I can tell), I have attached a screen shot of those settings in my php.ini. The IP is the IP of the machine with PHPstorm installed on it.

Is there anything else you need to help with this issue?



Attachment(s):
phpstorm debug.png
xdebug-settings.png
0

Hi Mike,

Those settings that you have shown are fine.

I am trying to use xdebug. The php code sits on another machine than PHPStorm so I am making the remote connection.
Is there anything else you need to help with this issue?

Yes:

  1. How do you initiate debug session?
  2. What do you mean by "remote connection"?
  3. Are you trying to debug web page (on remote server) or some cli-script (on remote server)?
  4. Where that "another machine" is -- your LAN or somewhere on internet? (maybe you need to configure your firewall/router to allow accepting xdebug connections)
  5. Does debugging works fine if you debug local script (obviously, you need local php installation to check this)?
0
Avatar
Permanently deleted user

How do you initiate debug session?

In PHPStorm, I hit the green call button in the tool bar. Then over in chrome I turn on xdebug helper. I make sure to add a break point into my code, and refresh the page. This is when I get the error message in PHPStorm. I hope that's what you were looking for.


What do you mean by "remote connection"?

PHPStorm and the PHP code are living on different machines. PHPStorm is at my desk and the code is on another server.

Are you trying to debug web page (on remote server) or some cli-script (on remote server)?

Webpage

Where  that "another machine" is -- your LAN or somewhere on internet? (maybe  you need to configure your firewall/router to allow accepting xdebug  connections)

LAN. It is actually a virtual machine running on the host machine, but they both have seperate IPs on the network.

Does debugging works fine if you debug local script (obviously, you need local php installation to check this)?

I haven't tried, I do not have PHP installed locally at the moment

0
Avatar
Permanently deleted user

Having the same problem as topic starter, tried many tricks but still not resolved. Everything is runing on local machine. Using Denwer latest release Apache Version: Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c PHP/5.3.13
I`am not using a CLI debuging, trying to setup debuging for a localy stored projects. Found a soution that I need run this comannd in command promt export PHP_IDE_CONFIG="serverName=server_name"  but there is no CLI in Denwer at all.

Here are my xdebus settings:

[xdebug]
zend_extension="\usr\local\php5\ext\php_xdebug-2.2.0-5.3-vc9.dll"
xdebug.auto_trace = 0
xdebug.default_enable = 1
xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD
xdebug.extended_info = 0
xdebug.profiler_enable = 1
xdebug.profiler_output_name = "cachegrind.out.%u"
xdebug.remote_autostart = 0
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.idekey=PHPSTORM
xdebug.profiler_enable_trigger=1
xdebug.trace_output_dir="C:\WebServers\xdebug"
xdebug.profiler_output_dir="C:\WebServers\xdebug"


Everything is running on Windows 7 Ultimate
Using Google Chome 19 Browser with Xdebug helper 1.0.1  extention that helps to start xdebug session.


My suggestions for your team, It will be very usefull if It would be possible to install all pack for example Denwer + PHPStorm from one .exe, cause I found a lot of posts in Google with almost the same troubles.

Thanks for your help.



Attachment(s):
setts2.png
server conf.jpg
debugSettings.jpg
0

Hi Kirill,

You are wrong in your assumption about me.

Now about the actual topic:

  • How did you created "checker" server entry in "Settings | PHP | Servers" -- manually or PhpStorm helped you (dialogue poped up during first debug session)?
  • What URL this site has? I ssume it's http://checker/somepage.php (or something like that -- actual page does not matter -- only host/domain name).
  • I also see that you ticked "Use path mappings" but not actual mappings are specified (should not matter if files are where they are and no symbolic links / junction points are in use)


I would suggest trying this:

  • Delete "checker" entry from "Settings | PHP | Servers"
  • Delete "checker" entry from Run/Debug Configurations (Run | Edit Configurations...)
  • Get rid of PHP_IDE_CONFIG="serverName=server_name" (may require restart, at least for PhpStorm itself and webserver).
  • Start listen or PHP Debug connection -- make phone handle icon green
  • Initiate debug session from browser
  • When PhpStorm accepts incomming debug connection, it will show you some dialog window asking for path mappings etc -- use it (in most cases, especially simple one, when there is no need to setup multiple mappings, it sets correct values automatically).
0
Avatar
Permanently deleted user

Also tried to feed Denwer`s php5 directory as an PHP Interpreter, wasn`t successfull, don`t know why ((

0

Interpreter is only required for running/debugging local PHP scripts/PHPUnit tests. It is not required for web-based debug (even if everything is on the same computer).

Give me URL for Denwer to download -- I may try it myself later in virtual environment.

0

OK -- no issues so far. Can you show screenshot of "Settings | PHP | Servers", please.

0

It has to be some misconfiguration somewhere (my guess, never faced this myself). For whatever reason PhpStorm treats incomming connection as CLI connection -- the $_SERVER['PHP_IDE_CONFIG'] is intended for remote CLI debug -- http://youtrack.jetbrains.com/issue/WI-7906

I do not want to spam with possibly (likely) wrong ideas/suggestions if I cannot see all the details of the incomming request.

Righ now I can only suggest to:

  • Place this kind of simple script into your website and try debug it: <?php phpinfo(); ?>
  • The interesting sections are at the end:  "Environment" and "PHP Variables"

Maybe one of those values are triggering such behaviour.

0
Avatar
Permanently deleted user

I have replaced the name of my company with "website", the url is the url of the virtual machine.



Attachment(s):
settings-php-servers.png
0
Avatar
Permanently deleted user

http://denwer.ru  there you can download denwer

tried again to recreate project

  • How did you created "checker" server entry in "Settings | PHP | Servers" -- manually or PhpStorm helped you (dialogue poped up during first debug session)?

-- yes manualy, now recreated witch dialog when was Creatin project from existing file, with first option, local webserver with files in it`s root

  • What URL this site has? I ssume it's http://checker/somepage.php (or something like that -- actual page does not matter -- only host/domain name).

-- http://checker

  • I also see that you ticked "Use path mappings" but not actual mappings are specified (should not matter if files are where they are and no symbolic links / junction points are in use)

-- wasn`t selected this time

Nothing helped this time the same error occured ((


here is a list of phpinfo() variables section

Variable Value
_COOKIE["XDEBUG_SESSION"] PHPSTORM
_SERVER["HTTP_HOST"] checker
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows NT 6.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.43 Safari/536.11
_SERVER["HTTP_ACCEPT"] text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
_SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate,sdch
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-US,en;q=0.8,ru;q=0.6
_SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.3
_SERVER["HTTP_COOKIE"] XDEBUG_SESSION=PHPSTORM
_SERVER["PATH"] \usr\local\ImageMagick;\usr\local\php5;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\OpenVPN\bin
_SERVER["SystemRoot"] C:\Windows
_SERVER["COMSPEC"] C:\Windows\system32\cmd.exe
_SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
_SERVER["WINDIR"] C:\Windows
_SERVER["SERVER_SIGNATURE"] <address>Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c PHP/5.3.13 Server at checker Port 80</address>
_SERVER["SERVER_SOFTWARE"] Apache/2.2.22 (Win32) mod_ssl/2.2.22 OpenSSL/1.0.1c PHP/5.3.13
_SERVER["SERVER_NAME"] checker
_SERVER["SERVER_ADDR"] 127.0.0.1
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["DOCUMENT_ROOT"] Z:/home/checker/www
_SERVER["SERVER_ADMIN"] admin@example.com
_SERVER["SCRIPT_FILENAME"] Z:/home/checker/www/info.php
_SERVER["REMOTE_PORT"] 61174
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /info.php
_SERVER["SCRIPT_NAME"] /info.php
_SERVER["PHP_SELF"] /info.php
_SERVER["REQUEST_TIME"] 1340908652
_SERVER["argv"]
Array
(
)
_SERVER["argc"] 0




Environment

Variable Value
no value Z:=Z:\usr\local\apache
ALLUSERSPROFILE C:\ProgramData
APPDATA C:\Users\Admin\AppData\Roaming
CommonProgramFiles C:\Program Files\Common Files
COMPUTERNAME ADMIN-PC
ComSpec C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK NO
HOMEDRIVE C:
HOMEPATH \Users\Admin
LOCALAPPDATA C:\Users\Admin\AppData\Local
LOGONSERVER \\ADMIN-PC
NUMBER_OF_PROCESSORS 2
OS Windows_NT
Path \usr\local\ImageMagick;\usr\local\php5;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PHPRC \usr\local\php5
PROCESSOR_ARCHITECTURE x86
PROCESSOR_IDENTIFIER x86 Family 6 Model 23 Stepping 10, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 170a
ProgramData C:\ProgramData
ProgramFiles C:\Program Files
PROMPT $P$G
PSModulePath C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC C:\Users\Public
SystemDrive C:
SystemRoot C:\Windows
TEMP C:\Users\Admin\AppData\Local\Temp
TMP C:\Users\Admin\AppData\Local\Temp
USERDOMAIN Admin-PC
USERNAME Admin
USERPROFILE C:\Users\Admin
VS100COMNTOOLS C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\
windir C:\Windows
AP_PARENT_PID 1656
0

No new ideas so far -- will try Denwer later tonight. Are there any special things I need to do when setting it up (I mean -- to match your environment as close as possible) e.g. particular paths or config values? Can you share some info on what you have there?

Don't know if this will be of any help (as you seems to have it working ok, I mean -- in general), but still:

0
Avatar
Permanently deleted user

There is no special things to setup, common setup what will suggest installer for you just agree.

Yep, I saw that link, started to setup all this stuff after reading, but suddenly got this error ((

0

Can you post your xdebug config as well, please.

0
Avatar
Permanently deleted user

Any ideas after seeing my server configs?

0
Avatar
Permanently deleted user

Inserted a TAB before line which is not commented


; XDebug settings.
[xdebug]
     zend_extension="\usr\local\php5\ext\php_xdebug-2.2.0-5.3-vc9.dll"
     xdebug.auto_trace = 0
;xdebug.collect_includes = 1
;xdebug.collect_params = 0
;xdebug.collect_return = 0
;xdebug.collect_vars = 0
     xdebug.default_enable = 1
     xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD
;xdebug.dump.COOKIE = ""
;xdebug.dump.FILES = ""
;xdebug.dump.GET = ""
;xdebug.dump.POST = ""
;xdebug.dump.REQUEST = ""
;xdebug.dump.SERVER = ""
;xdebug.dump.SESSION = ""
;xdebug.dump_globals = 1
;xdebug.dump_once = 1
;xdebug.dump_undefined = 0
     xdebug.extended_info = 0
;xdebug.file_link_format = ""
;xdebug.manual_url = "http://www.php.net"
;xdebug.max_nesting_level = 100
;xdebug.overload_var_dump = 1
;xdebug.profiler_append = 0
     xdebug.profiler_enable = 1
;xdebug.profiler_output_dir="/tmp"
     xdebug.profiler_output_name = "cachegrind.out.%u"
     xdebug.remote_autostart = 0
     xdebug.remote_enable = 1
     xdebug.remote_handler = dbgp
     xdebug.remote_host = 127.0.0.1
;xdebug.remote_log = "none"
;xdebug.remote_mode = "req"
     xdebug.remote_port = 9100
;xdebug.show_exception_trace = 0
;xdebug.show_local_vars = 0
;xdebug.show_mem_delta = 0
;xdebug.trace_format = 0
;xdebug.trace_options = 0
;xdebug.trace_output_name = "trace.%H%R"
;xdebug.var_display_max_children = 128
;xdebug.var_display_max_data = 512
;xdebug.var_display_max_depth = 3
     xdebug.idekey=PHPSTORM
     xdebug.profiler_enable_trigger=1
     xdebug.trace_output_dir="C:\WebServers\xdebug"
     xdebug.profiler_output_dir="C:\WebServers\xdebug"

0

OK, I have installed Denwer with all defaults (had issues with encoding (since all text is in Russian and my system locale is English) + issues with editing hosts file & creating virtual drive (Denwer is NOT UAC friendly for sure). But since I know what may caused it, I found my way around.

It took a while to figure out how Denwer works (there is no need to create new sites by editing config files -- just copy already made example and it does the rest on restart) .. but it's all in the past.

So -- everything is set to their defaults (fresh install of PhpStorm as well -- easy to do in virtual environment).

Here are my xdebug settings (only active settings (I've quickly uncommented only some of them -- it was enough) -- don't forget to restart Denwer after making such changes):

[xdebug]
zend_extension="\usr\local\php5\ext\php_xdebug-2.2.0-5.3-vc9.dll"
xdebug.auto_trace = 0
xdebug.default_enable = 0
xdebug.idekey = "PHPSTORM"
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir="/tmp"
xdebug.profiler_output_name = "cachegrind.out.%u"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "localhost"
xdebug.remote_mode = "req"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "/tmp"


Installed "Xdebug helper 1.0.1" extension for Chrome, configured it (key = PHPSTORM)

In PhpStorm, created new project via "File | Open Directory" --> C:\WebServers\home\checker\www
Created simple index.php (C:\WebServers\home\checker\www\index.php)

<?php
phpinfo();

No other project or IDE configuration (at all).
Set breakpoint at line 2
Activated "Start Listen to PHP Debug Connections"
Activated debug session in Chrome and launched the page: http://checker/
PhpStorm detected incoming debug connection and asked for path mappings. Accepted what was offered: C:\WebServers\home\checker\www <--> Z:\home\checker\www

That's it -- debugging works just fine. Don't know what may be wrong here on your side.

0

Sorry -- no news.

Everything seems ok for me (at least from overhere).

From what I understand your debug configuration is ok. The only thing I may suggest right now is to try fresh installation (backup and delete PhpStorm settings -- you can restore them later: C:\Users\USERNAME\.WebIde40 ) and maybe try latest EAP build (in case you are using release version -- http://confluence.jetbrains.net/display/WI/Web+IDE+EAP

0
Avatar
Permanently deleted user

Thanks,

I will give that an attempt tomorrow and report back

Mike

0
Avatar
Permanently deleted user

THANKS A LOT!!!

Don`t know for shure in what was this error what I made to make it start:

I copied your xdebug settings copied them in a single block on the beginning of the settings list(all other commented), then I restarted Denwer


After this all worked fine. By the way in old project removed all server and debugging settings and leaved no settings, turned on Call button and it worked nice.

Thanks again!!

0
Avatar
Permanently deleted user

I uninstalled PHPStorm 4.0.2 and installed the EAP version.

I am still getting the exact same issue.

Any other ideas?

0

Well .. another guy (Kirill) have solved such issue .. so I think it may be related to the actual xdebug config. But, TBH, I do not know what that can be.

Maybe (just maybe) try getting rid of xdebug.remote_connect_back option (I saw one post (here on forum IIRC) that usage of this option + browser extension at the same time was causing the issue (unable to initiate debug session at all) -- it's different to what you have here (at least that's what I think), but maybe worth checking it out.

Another person here on forum (he was unable to establish debug session at all) have said that ide key has to be in quotes (only after he added them it started working): xdebug.idekey = "PHPSTORM" ( http://devnet.jetbrains.net/message/5449244 -- very last post). Once again -- it looks different to what you have here ... plus it worked fine without quotes when I was testing it...

If none of this works -- I may only suggest submitting a ticket on Issue Tracker (it may have better chances of being spotted by relative/responsible for this subject dev): http://youtrack.jetbrains.net/dashboard/WI

0
Avatar
Permanently deleted user

Attempted both..no luck. Thanks for you help, I am going to submit a ticket now.


0

Last idea (don't think this will do anything since Kirill has it from beginning) -- considering that message says "Cannot evaluate expression..." ... try ticking "Settings | PHP | Debug | Safe evaluation mode"

0
Avatar
Permanently deleted user

No such luck.

Thanks again though

0
Avatar
Permanently deleted user

Mike,

Finally I've found a cause of the issue - you have loaded your xdebug as extension, but it should be loaded as zend_extension (see - http://youtrack.jetbrains.com/issue/WI-11876#comment=27-354589).
I'll improve the error message in the PhpStorm (it definitely should include some suggestions how to fix the issue).

Thank you for feedback!

0
Avatar
Permanently deleted user

Mike,

Please vote - http://youtrack.jetbrains.com/issue/WI-12032

Thank you for feedback!

0
Avatar
Permanently deleted user

Hi guys, I have a similar problem.

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

0
Avatar
Permanently deleted user

Started a separate thread for this: http://devnet.jetbrains.com/thread/441766

0

Please sign in to leave a comment.