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
Please sign in to leave a comment.
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.
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
Hi Mike,
Those settings that you have shown are fine.
Yes:
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
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
Hi Kirill,
You are wrong in your assumption about me.
Now about the actual topic:
I would suggest trying this:
Also tried to feed Denwer`s php5 directory as an PHP Interpreter, wasn`t successfull, don`t know why ((
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.
OK -- no issues so far. Can you show screenshot of "Settings | PHP | Servers", please.
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:
Maybe one of those values are triggering such behaviour.
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
http://denwer.ru there you can download denwer
tried again to recreate project
-- yes manualy, now recreated witch dialog when was Creatin project from existing file, with first option, local webserver with files in it`s root
-- http://checker
-- wasn`t selected this time
Nothing helped this time the same error occured ((
here is a list of phpinfo() variables section
Environment
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:
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 ((
Can you post your xdebug config as well, please.
Any ideas after seeing my server configs?
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"
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):
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)
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.
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
Thanks,
I will give that an attempt tomorrow and report back
Mike
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!!
I uninstalled PHPStorm 4.0.2 and installed the EAP version.
I am still getting the exact same issue.
Any other ideas?
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
Attempted both..no luck. Thanks for you help, I am going to submit a ticket now.
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"
No such luck.
Thanks again though
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!
Mike,
Please vote - http://youtrack.jetbrains.com/issue/WI-12032
Thank you for feedback!
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...
Started a separate thread for this: http://devnet.jetbrains.com/thread/441766