MantisBT - Xdebug
View Issue Details
0001566XdebugRemote Debuggingpublic2018-07-22 05:022018-07-22 05:02
0001566: 2.7.0alpha1 cannot debug swoole extension
this fix(2.7.0alpha1) [^]
brings other bug [^] [^]
swoole http svr cannot break with xdebug 2.7.0alpha1(in child process)
bug xdebug 2.6.0 is ok(both in parent and child processes)
here is an example <<simple_http.php>>
$http = new swoole_http_server('', 9502); //parent process can break with both 2.6.0&2.7.0alpha
$conf = [
    'pid_file' => __DIR__ . '/',
    'worker_num' => 1,
    'max_request' => 10,
    'daemonize' => 0,

$http->on('request', function ($request, $response) {
    xdebug_break(); //child process cannot break with 2.7.0alpha, but 2.6.0 is OK
    $response->header('Content-Type', 'text/html; charset=utf-8');
    $response->end('<h1>Hello Swoole. #' . rand(1000, 9999) . '</h1>');

I do remote debug with phpstorm

1. phpstorm "Run/Debug Configurations",add "PHP Remote Debug",give it an arbitrary name,no other settings in this dialog

2. phpstorm
File | Settings | Languages & Frameworks | PHP | Servers
Name: simple_http(should be the same with serverName in PHP_IDE_CONFIG in step 3)
Host: your server ip
Port: your server port(9502 in this example)
Debugger: xdebug
select "Use path mappings"
and config the path mapping

3. before start(tell phpstorm to use which server configuration)
export PHP_IDE_CONFIG="serverName=simple_http"

4. start cmd
php -dxdebug.remote_enable=1 -dxdebug.remote_mode=jit -dxdebug.remote_port=9000 -dxdebug.remote_host= -dxdebug.remote_autostart=1 simple_http.php

it breaks in first xdebug_break()

but when i send
"curl" [^] [^]
xdebug 2.6.0 can break in second xdebug_break()
xdebug 2.7.0alpha cannot break
No tags attached.
Issue History
2018-07-22 05:02leonxingNew Issue

There are no notes attached to this issue.