php xdebug doesn't work - Error: Socket not writable - php

I use php xdebug, xampp and VScode, but today xdebug unexpectedly stopped working... 
The error it gives me is this: "continueRequest thread ID 1 error: socket not writable".
Can anyone here help me get it working again?
I have another php project that works fine, but in this project it gives me this error. Thanks in advance.
this is my php.ini:
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-3.1.5-7.2-vc15-x86_64.dll"
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.start_with_request=yes
xdebug.remote_port=9001
xdebug.remote_connect_back=0
xdebug.mode=debug
xdebug.remote_log="C:\xampp\php\tmp\xdebug.log"
I've tried in a different port but nothing happens
this is the full error in Debug Console:
Error: socket not writable
at c:\Users\andre\.vscode\extensions\xdebug.php-debug-1.31.1\out\dbgp.js:140:24
at new Promise (<anonymous>)
at Connection.write (c:\Users\andre\.vscode\extensions\xdebug.php-debug-1.31.1\out\dbgp.js:132:16)
at Connection._executeCommand (c:\Users\andre\.vscode\extensions\xdebug.php-debug-1.31.1\out\xdebugConnection.js:683:20)
at Connection.<anonymous> (c:\Users\andre\.vscode\extensions\xdebug.php-debug-1.31.1\out\xdebugConnection.js:625:26)
at Connection.emit (node:events:526:28)
at Connection._handleDataChunk (c:\Users\andre\.vscode\extensions\xdebug.php-debug-1.31.1\out\dbgp.js:111:22)
at Connection._handleDataChunk (c:\Users\andre\.vscode\extensions\xdebug.php-debug-1.31.1\out\dbgp.js:76:26)
at Socket.<anonymous> (c:\Users\andre\.vscode\extensions\xdebug.php-debug-1.31.1\out\dbgp.js:47:42)
at Socket.emit (node:events:526:28)

This configs solves my issue:
[Xdebug]
zend_extension="/path/to/xdebug.so"
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_port=9003
xdebug.discover_client_host=true

Related

How can I connect Xdebug 3 to PhpStorm on Windows 10?

I'm trying to connect PhpStorm and debug PHP scripts/webpages with Xdebug, something I've done several times.
This is my php.ini file (the interesting bit):
[xdebug]
zend_extension=C:\xampp\php\ext\php_xdebug.dll
xdebug.remote_enable=1
xdebug.remote_port=10000
xdebug.remote_mode=req
I set multiple breakpoints and called xdebug_break() on my index but code execution is not stopping at them.
This is the PhpStorm validation script output for Xdebug:
The output of netstat which shows that PhpStorm is listening on port 10000:
Change
from
xdebug.remote_enable=1
xdebug.remote_port=10000
xdebug.remote_mode=req
into
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.client_port=10000
Change the lines in the php.ini to
xdebug.mode=debug
and set the port on PhpStorm to listen on 9003 instead of 9000.
In xdebug v3 the default xdebug port was changed to 9003:
https://xdebug.org/docs/upgrade_guide#Step-Debugging

Waiting for incoming connection with ide key '19853'

I have gone through all the questions with this title, but I am still stuck here.
Here is my php.ini conf settings
[xdebug]
zend_extension=/usr/lib/php/20151012/xdebug.so
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.show_local_vars=0
xdebug.var_display_max_data=10000
xdebug.var_display_max_depth=20
xdebug.show_exception_trace=0
xdebug.idekey="xdebug"
xdebug.remote_log="/tmp/xdebug.log"
here is phpinfo()
here is PhpStorm server config
PhpStorm xdebug config
Now if I submit the request in debug mode in PhpStorm REST client, I get this error.
Waiting for incoming connection with ide key '19853'
I don't know how else to fix this.

XDebug is pausing just once

I'm using PHPStorm and Xdebug. I'm trying to debug a Web Application Project configured in my localhost. There are no symbolic links in my project path.
Below is Xdebug configuration in my php.ini:
[Xdebug]
xdebug.remote_port=9000
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.profiler_enable=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.idekey = "PHPSTORM"
xdebug.profiler_output_dir="/tmp"
xdebug.remote_log="/tmp/xdebug.log"
zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
Below are two variables exported in my zsh:
export PHP_IDE_CONFIG="serverName=localhost"
export XDEBUG_CONFIG="idekey=PHPSTORM"
Below is server configuration:
Below is debug configuration:
Below is the screenshot of first breakpoint where I see no variable values.
Below is the screenshot after 'Step In'. It shows: Waiting for incoming connection with ide key 'PHPSTORM'.
I get below message in event log:
Debug session was finished without being paused.
It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
To figure out the problem check path mappings configuration for 'dev.sales-crm.com' server at PHP|Servers or enable Break at first line in PHP scripts option (from Run menu).
My problem is: after debugging is started, then control stops at first breakpoint. It shows no variables values. Then If I try to 'step into', then debugging stops.
Please help me. Below is the link to xdebug logs: xdebug.log
I upgraded my Xdebug version form Xdebug 2.5.0rc1 to Xdebug v2.5.0 and it started working.
Thank you very much.

Waiting for connection(netbeans-xdebug)

i am trying to debug my php code in netbeans. the code runs perfectly but i am unable to debug it(doesn't stop at breakpoint) and the code runs normally.
i have tried every possible workaround in order to get my xdebug working and has been stuck from past few days.. anyone out there who can help me sort out this issue.
xdebug configuration in .ini file:
zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=mgiplocalhost
xdebug.remote_port=9000
here mgiplocalhost is my virtual host.
i have tried with other possibilities as well like localhost and ip address but the waiting for connection still exists.
In netbeans->tools->options->debugging when i set my port as 9000 and debug it asks me to change the port since port 9000 is already in use. i have changing the port but the problem persist.
please i need help to sort it out asap. please help me out.
A bit late but thought this should have an answer! To get Xdebug working, the minimal configuration I found I needed in the php.ini file was the line to load the extension:
zend_extension=php_xdebug.dll (pointing to the downloaded dll from the Xdebug site)
And the following Xdebug settings also placed further down in the php.ini file:
[Xdebug]
xdebug.remote_autostart=On
xdebug.remote_enable=On
xdebug.idekey="netbeans-xdebug"
The Xdebug default port was 9000, and that is also what Netbeans was using (Tools -> Options... -> PHP -> Debugging.) If 9000 is in use, you could also set that in Netbeans to be 9001 and in the php.ini file add the line xdebug.remote_port=9001 with your other xdebug settings.
Then try it out after restarting the server.

XDebug installed but doesn't show in phpinfo() and doesn't work

I am trying to get my php debugger for NetBeans to work in Ubuntu. When I try to start a debug session, it tries forever to establish a connection, but eventually it gives me an error message saying no connection to netbeans-xdebug was available. I have installed php5-xdebug, but when I try to see it using phpinfo() it doesn't show. My php/apache2/php.ini has these lines of code:
zend_extension=/usr/lib/php5/20090626/xdebug.so
[debug]
; Remote settings
xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
; General
xdebug.auto_trace=off
xdebug.collect_includes=on
xdebug.collect_params=off
xdebug.collect_return=off
xdebug.default_enable=on
xdebug.extended_info=1
xdebug.manual_url=http://www.php.net
xdebug.show_local_vars=0
xdebug.show_mem_delta=0
xdebug.max_nesting_level=100
;xdebug.idekey=
; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32
; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32
As you can see, I have tried to solve it myself, but I just can't get it to work. Any help would be greatly appreciated...
Find out first from where your php.ini is call using the flowing command line in ubuntu:
php -i |grep "php.ini"
You can test if xdebug it is working with the folowing code in a php file:
<?php
function test(){
echo "Called # ".xdebug_call_file().
":".xdebug_call_line()." from".
xdebug_call_function();
}
test();
?>
and run the script like that:
php -e myphpfile.php
you will get something like:
Called # /var/www/testxdebug.php:8 from{main}root#magento b
good luck
i guess that you've edited the wrong php.ini
i don't if it is the case in your machine, at least in mine, there's four directories in the /etc/php5/ folder: /apache2, /apache2fiter, /cli ; sometimes you need to edit the php.ini file under the /apache2filter folder to activate Xdebug~ hope it works

Categories