View Issue Details

IDProjectCategoryView StatusLast Update
0002246XdebugStep Debuggingpublic2024-05-27 11:01
Reportervlad.babayan Assigned Toderick  
Status feedbackResolutionopen 
PlatformAMD64OSWindows 11OS Version22H2
Product Version3.3.1 
Summary0002246: Nginx + PHP-FPM 8.1.27 with Xdebug 3.3.1 502 Bad Gateway Error

I have an Ubuntu 22.04 VirtualBox VM, with Docker installed on it with 2 containers - nginx:latest configured for fastcgi_pass and php-fpm:8.1.27-fpm. There is a simple 'Hello World' index.php. When I make a GET request with Postman to Nginx container, it gives 502 bad gateway error (with Xdebug 3.3.1). When I downgrade to Xdebug 3.2.2, it gives 200 OK.

Steps To Reproduce

Provision an Ubuntu 22.04 VM, Install Docker on it, run Nginx and PHP-FPM containers, configure them, install Xdebug on PHP-FPM container, make GET requests with Postman or even via browser.

Additional Information

php -v
PHP 8.1.27 (cli) (built: Feb 1 2024 03:02:44) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.27, Copyright (c) Zend Technologies
with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans


php.ini # (Xdebug Part)





Nginx Conf


server {
root /var/www/html;
location / {
index index.php index.html;
location ~ .php$ {
include fastcgi_params;
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;

Tagsphp8.1, xdebug
Operating SystemWindows 11 22H2
PHP Version8.1.10-8.1.19



2024-02-23 06:10

reporter   ~0006851

I had the same issue with PHP 8.1 and Xdebug 3.3.1 on an M2 Macbook Pro. Downgrading to 3.2.2 has worked for me also.
More information on my issue and be found here


2024-02-23 09:30

reporter   ~0006852

same issue as well (PHP 8.1, Xdebug 3.3.2, M2 Macbook Pro), only when listening to xdebug connections (PhpStorm), downgrading to 3.2.2 worked.


2024-02-23 09:40

reporter   ~0006853

Xdebug 3.3.1* :)


2024-02-23 12:09

reporter   ~0006854

The latest working version is 3.3.0alpha2, starting from 3.3.0alpha3 there is this problem.


2024-02-29 12:25

reporter   ~0006857

I have the same crash. the backtrace points at Xdebug:

GI___memmove_falkor () at ../sysdeps/aarch64/multiarch/memcpy_falkor.S:310
310 ../sysdeps/aarch64/multiarch/memcpy_falkor.S: No such file or directory.
(gdb) bt
GI___memmove_falkor () at ../sysdeps/aarch64/multiarch/memcpy_falkor.S:310
#1 0x0000ffff7c2afd5c in xdebug_str_internal_addl (f=0, le=18, str=0xffff7c2d7fd0 "<tr><td class=\"i\">",
xs=0xaaaac3bd2ca0) at /build/downloads/xdebug/src/lib/str.c:44
0000002 xdebug_str_addl (xs=0xaaaac3bd2ca0, str=str@entry=0xffff7c2d7fd0 "<tr><td class=\"i\">", le=le@entry=18,
f=f@entry=0) at /build/downloads/xdebug/src/lib/str.c:60
0000003 0x0000ffff7c2ae258 in xdebug_diagnostic_log (
message=0xaaaac3cfbe30 "Select failed: Bad file descriptor", error_code=0xffff7c2d6b50 "CTRL-SELECT",
log_level=<optimized out>, channel=0) at /build/downloads/xdebug/src/lib/log.c:106
0000004 xdebug_log_ex (channel=channel@entry=0, log_level=log_level@entry=3,
error_code=error_code@entry=0xffff7c2d6b50 "CTRL-SELECT",
fmt=fmt@entry=0xffff7c2d6b38 "Select failed: %s") at /build/downloads/xdebug/src/lib/log.c:170
0000005 0x0000ffff7c2a86c8 in xdebug_control_socket_handle ()
at /build/downloads/xdebug/src/base/ctrl_socket.c:256
0000006 0x0000aaaab0855f6c in zend_llist_apply_with_argument (l=<optimized out>,
func=func@entry=0xaaaab0883194 <zend_extension_statement_handler>, arg=0xffff7c813020)
at /build/downloads/php-8.3.2/Zend/zend_llist.c:236
0000007 0x0000aaaab04a385c in ZEND_EXT_STMT_SPEC_HANDLER ()
at /build/downloads/php-8.3.2/Zend/zend_vm_execute.h:3035
0000008 0x0000aaaab08e5d14 in execute_ex (ex=0x1555587823dc0)
at /build/downloads/php-8.3.2/Zend/zend_vm_execute.h:57296
0000009 0x0000ffff79458440 in ?? () from /opt/php/8.3/lib/php/extensions/no-debug-non-zts-20230831/
0000010 0x0000aaaab08e5f8c in zend_execute (op_array=0xffff7c8fe000, return_value=<optimized out>)
at /build/downloads/php-8.3.2/Zend/zend_vm_execute.h:61604
0000011 0x0000ffff79476480 in bf_load_embedded_code ()
from /opt/php/8.3/lib/php/extensions/no-debug-non-zts-20230831/
0000012 0x0000ffff7945da28 in zm_activate_blackfire ()
from /opt/php/8.3/lib/php/extensions/no-debug-non-zts-20230831/
0000013 0x0000aaaab086a8b0 in zend_activate_modules () at /build/downloads/php-8.3.2/Zend/zend_API.c:3202
0000014 0x0000aaaab07f95b8 in php_request_startup () at /build/downloads/php-8.3.2/main/main.c:1805
0000015 0x0000aaaab04b0fe0 in main (argc=<optimized out>, argv=<optimized out>)
at /build/downloads/php-8.3.2/sapi/fpm/fpm/fpm_main.c:1859


2024-02-29 12:31

reporter   ~0006858

seeing that the backtrace points at the control socket, I have set


in my php.ini as I don't need this feature. This has solved the crash for me.


2024-03-01 01:40

reporter   ~0006859

xdebug.control_socket=off did not work for me with PHP 8.1


2024-04-15 13:47

administrator   ~0006911

I have released Xdebug 3.3.1, which could have fixed this issue. Can you please try it? (I don't think it will, but it would be good to test. And it does fix some other bugs too)


2024-05-06 10:24

administrator   ~0006934

Can you provide the requested feedback please?


2024-05-27 10:46

reporter   ~0006958

I'm also having the problem with 502 error from nginx (laravel valet windows), it happens only when I enable XDEBUG_SESSION cookie. PHP 8.3, tried couple versions of XDebug, 3.3.0-alpha2, 3.3.0, 3.3.2.
I'm not quite sure which logs should I provide for you, if you could give me some hints how to generate them I'll paste them here.


2024-05-27 10:55

reporter   ~0006959

This is my configuration:
PHP 8.3.2 (cli) (built: Jan 16 2024 20:48:07) (NTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.3.2, Copyright (c) Zend Technologies
with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans

image.png (68,176 bytes)   
image.png (68,176 bytes)   


2024-05-27 11:01

reporter   ~0006960

What is more interesting is that when I make a request which contains XDEBUG_SESSION=PHPSTORM then the request will fail with 502 Bad Gateway.
BUT when I make same request without cookie, but with ?XDEBUG_SESSION=PHPSTORM query string then everything work correctly and debugger properly stops at given breakpoint. Any idea what can actually happen here ?

Issue History

Date Modified Username Field Change
2024-02-12 18:08 vlad.babayan New Issue
2024-02-12 18:08 vlad.babayan Tag Attached: php8.1
2024-02-12 18:08 vlad.babayan Tag Attached: xdebug
2024-02-23 06:10 incon Note Added: 0006851
2024-02-23 09:30 RiseAndCry Note Added: 0006852
2024-02-23 09:40 RiseAndCry Note Added: 0006853
2024-02-23 12:09 vlad.babayan Note Added: 0006854
2024-02-29 12:25 pilif Note Added: 0006857
2024-02-29 12:31 pilif Note Added: 0006858
2024-03-01 01:40 incon Note Added: 0006859
2024-04-15 13:47 derick Assigned To => derick
2024-04-15 13:47 derick Status new => feedback
2024-04-15 13:47 derick Note Added: 0006911
2024-05-06 10:24 derick Note Added: 0006934
2024-05-27 10:46 zaalbarxx Note Added: 0006958
2024-05-27 10:55 zaalbarxx Note Added: 0006959
2024-05-27 10:55 zaalbarxx File Added: image.png
2024-05-27 11:01 zaalbarxx Note Added: 0006960