Getting 'Debug connection was not established' in script debug mode
Hi all,
I am trying to debug one php file with PHPStorm. XDebug already configured, and proven working with Netbeans. When I try to run the debug mode, I almost immediately get the 'Debug connection was not established' error. I tried to run it in cli with the 'listen to incoming debug connections' as well , but then PHPStorm replies with 'Cannot accept external XDebug connection, cannot evaluate expression $_SERVER['SERVER_PORT']. I am on a mac with php 5.3.2, xdebug 2.1.0 with the following config:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.1.66
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_autostart=1
Does anyone have any advice for these issues?
Thanks
Please sign in to leave a comment.
How is your PHPStorm configured?
Have you turned on Listen?
All the PHPStorm configurations were fine (I tried PHP Script debug as well, but that didn't work).
I got it to work with PHP Remote debug, but tried for a long time and not sure what exactly solved it, but my guess would go mainly for xdebug.ini, which is currently
zend_extension="/usr/lib/php5/20090626+lfs/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_host=192.168.1.167
xdebug.remote_autostart=1
xdebug.idekey="PHPSTORM"
xdebug.remote_connect_back=1
important modifications/changes
- I removed the remote_mode config line.
- if the script requires sudo, then the export command has to be run via sudo as well
- all other debug sessions have to be stopped in phpstorm (and other IDEs, obviously)
- I didnt turn on listen after all
Thanks
Zsolt
I use these settings:
zend_extension="c:/php/ext/php_xdebug-2.1.0-5.3-vc9-nts.dll"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9100
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
And then just click Listen when I am ready to debug.
Hello zsolt,
Looks like you have 'Zend Debugger' checked in Project Settings -> PHP. Please check your project settings.
Debug conection listener doesn't support cli yet, please vote - http://youtrack.jetbrains.net/issue/WI-5132
Thank you for feedback!
Hello zsolt,
Looks like you have 'Zend Debugger' checked in Project Settings -> PHP. Please check your project settings.
Debug conection listener doesn't support cli yet, please vote - http://youtrack.jetbrains.net/issue/WI-5132
Thank you for feedback!
Hello Keith,
Thanks for the help!
FYI:
These are default values.
zsolt,
Do you still have the issue?
Thank you for feedback!
Hi Nikolay,
eventually I managed to fix the issue. Like I said, I guess, that one or two bits might have been missing from the xdebug.conf file, but the most important change was that I exported the session key as root in cli as well. So, after all, definitely not a phpstorm issue.
Thanks again
Zsolt