View Issue Details

IDProjectCategoryView StatusLast Update
0002358XdebugStep Debuggingpublic2025-07-14 14:40
Reporterorome Assigned Toderick  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionno change required 
Product Version3.4.4 
Summary0002358: Please add a function to finish debug session
Description

Hi,

I am working with FrakenPHP. I was able to configure it to work with xdebug fine using xdebug_connect_to_client(). The problem is that after I am out side of frankenphp_handle_request(), to handle "next" request, xdebug is still connected from previous request.

Can you add a function that will be useful in all application servers/long running processes so that xdebug "finishes" the request, and clean up everything BUT it is ready for another xdebug_connect_to_client() ?

Thanks.

Steps To Reproduce

Have following worker:


$handler = static function (){
    xdebug_connect_to_client();
    print "hello world";
};

// to prevent memory leaks we finish worker every 10 000 requests
$maxRequests = (int)($_SERVER['MAX_REQUESTS'] ?? 5);
for($processedRequests = 0; $processedRequests < $maxRequests; $processedRequests++) {

    // keep running will be false if server (Caddy) is terminating to allow our code to finish
    $keepRunning = \frankenphp_handle_request($handler);
    if (!$keepRunning) break;
}

Following dockerfile:

FROM dunglas/frankenphp:1.6-php8.3-bookworm

RUN install-php-extensions xdebug-^3.3

EXPOSE 80
Tagsfrankenphp
Operating SystemLinux with Docker
PHP Version8.3.5-8.3.9

Activities

derick

2025-07-14 14:40

administrator   ~0007333

You can already do this, by letting your debug frontend (VS Code Plugin or PhpStorm) to "detach" from the session. I show that in https://youtu.be/jBvrVpNHOCw?feature=shared&t=222 (Starting at 3:42)

Issue History

Date Modified Username Field Change
2025-07-13 17:25 orome New Issue
2025-07-13 17:25 orome Tag Attached: frankenphp
2025-07-14 14:40 derick Assigned To => derick
2025-07-14 14:40 derick Status new => resolved
2025-07-14 14:40 derick Resolution open => no change required
2025-07-14 14:40 derick Note Added: 0007333