{"id":21650654,"url":"https://github.com/mougrim/php-xdebug-proxy","last_synced_at":"2026-02-23T21:29:19.141Z","repository":{"id":42480152,"uuid":"138002512","full_name":"mougrim/php-xdebug-proxy","owner":"mougrim","description":"PHP xdebug (dbgp) proxy server","archived":false,"fork":false,"pushed_at":"2025-02-24T05:59:18.000Z","size":239,"stargazers_count":88,"open_issues_count":0,"forks_count":8,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-28T13:08:59.154Z","etag":null,"topics":["dbgp","php-xdebug-proxy-server","proxy","xdebug","xdebug-proxy","xdebug-proxy-server"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mougrim.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-20T08:25:52.000Z","updated_at":"2025-02-24T06:04:40.000Z","dependencies_parsed_at":"2024-09-09T06:23:48.143Z","dependency_job_id":"d23f0e2c-29f0-47a6-8771-413381baafd2","html_url":"https://github.com/mougrim/php-xdebug-proxy","commit_stats":{"total_commits":38,"total_committers":4,"mean_commits":9.5,"dds":0.1842105263157895,"last_synced_commit":"aa33b6637e76981427f522f60110187189c5d3ec"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mougrim%2Fphp-xdebug-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mougrim%2Fphp-xdebug-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mougrim%2Fphp-xdebug-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mougrim%2Fphp-xdebug-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mougrim","download_url":"https://codeload.github.com/mougrim/php-xdebug-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190250,"owners_count":20898702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbgp","php-xdebug-proxy-server","proxy","xdebug","xdebug-proxy","xdebug-proxy-server"],"created_at":"2024-11-25T07:41:49.689Z","updated_at":"2026-02-23T21:29:14.120Z","avatar_url":"https://github.com/mougrim.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PHP xdebug (dbgp) proxy\n\nThis is [expandable](#extending) [dbgp](https://xdebug.org/docs-dbgp.php) xdebug proxy based on [amphp](https://amphp.org/).\n\nThe idea is described in the document [Multi-user debugging in PhpStorm with Xdebug and DBGp proxy](https://confluence.jetbrains.com/display/PhpStorm/Multi-user+debugging+in+PhpStorm+with+Xdebug+and+DBGp+proxy#Multi-userdebugginginPhpStormwithXdebugandDBGpproxy-HowdoesXdebugwork%3F).\n\nThe main benefit is that this proxy is written in php - the language you know.\n\n[![Latest Stable Version](https://poser.pugx.org/mougrim/php-xdebug-proxy/version)](https://packagist.org/packages/mougrim/php-xdebug-proxy)\n[![Latest Unstable Version](https://poser.pugx.org/mougrim/php-xdebug-proxy/v/unstable)](https://packagist.org/packages/mougrim/php-xdebug-proxy)\n[![License](https://poser.pugx.org/mougrim/php-xdebug-proxy/license)](https://packagist.org/packages/mougrim/php-xdebug-proxy)\n[![Unit tests status](https://github.com/mougrim/php-xdebug-proxy/actions/workflows/unit-tests.yml/badge.svg?branch=master\u0026event=push)](https://github.com/mougrim/php-xdebug-proxy/actions?query=branch%3Amaster)\n\n### Installation\n\nThis package can be installed as a [Composer](https://getcomposer.org/) project:\n\n```bash\ncomposer.phar create-project mougrim/php-xdebug-proxy\n```\n\nOr dependency:\n\n```bash\ncomposer.phar require mougrim/php-xdebug-proxy --dev\n```\n\nFor parse XML you should install `ext-dom`.\n\nFor write logs by default you should install `amphp/log` (use `--dev` if you installed `php-xdebug-proxy` as dependency):\n\n```bash\ncomposer.phar require amphp/log '^1.0.0'\n```\n\n\n### Run\n\nYou can run next command:\n```bash\nbin/xdebug-proxy\n```\n\nThe proxy will be run with default config:\n```text\nUsing config path /path/to/php-xdebug-proxy/config\n[2019-02-14 10:46:24] xdebug-proxy.NOTICE: Use default ide: 127.0.0.1:9000 array ( ) array ( )\n[2019-02-14 10:46:24] xdebug-proxy.NOTICE: Use predefined ides array (   'predefinedIdeList' =\u003e    array (     'idekey' =\u003e '127.0.0.1:9000',   ), ) array ( )\n[2019-02-14 10:46:24] xdebug-proxy.NOTICE: [Proxy][IdeRegistration] Listening for new connections on '127.0.0.1:9001'... array ( ) array ( )\n[2019-02-14 10:46:24] xdebug-proxy.NOTICE: [Proxy][Xdebug] Listening for new connections on '127.0.0.1:9002'... array ( ) array ( )\n```\n\nSo by default proxy listens `127.0.0.1:9001` for ide registration connections and `127.0.0.1:9002` for xdebug connections, use `127.0.0.1:9000` as default IDE and predefined IDE with key `idekey`.\n\n### Config\n\nIf you want to configure listening ports, etc., you can use custom config path. Just copy [`config`](config) directory to your custom path:\n\n```bash\ncp -r /path/to/php-xdebug-proxy/config /your/custom/path\n```\n\nThere are 3 files:\n\n- [`config.php`](config/config.php):\n    ```php\n    \u003c?php\n    return [\n        'xdebugServer' =\u003e [\n            // xdebug proxy server host:port\n            'listen' =\u003e '127.0.0.1:9002',\n        ],\n        'ideServer' =\u003e [\n            // if proxy can't find ide, then it uses default ide,\n            // pass empty string if you want to disable default ide\n            // defaultIde is useful when there is only one user for proxy\n            'defaultIde' =\u003e '127.0.0.1:9000',\n            // predefined ide list in format 'idekey' =\u003e 'host:port',\n            // pass empty array if you don't need predefined ide list\n            // predefinedIdeList is useful when proxy's users aren't changed often,\n            // so they don't need to register in proxy each proxy restart\n            'predefinedIdeList' =\u003e [\n                'idekey' =\u003e '127.0.0.1:9000',\n            ],\n        ],\n        'ideRegistrationServer' =\u003e [\n            // host:port for register ide in proxy\n            // pass empty string if you want to disable ide registration\n            'listen' =\u003e '127.0.0.1:9001',\n        ],\n    ];\n    ```\n- [`logger.php`](config/logger.php): you can customize a logger, the file should return an object, which is instance of `\\Psr\\Log\\LoggerInterface`;\n- \u003ca name=\"factory-php\"\u003e\u003c/a\u003e[`factory.php`](config/factory.php): you can [customize classes](#extending), which are used in proxy, file should return object, which is instanceof [`Factory\\Factory`](src/Factory/Factory.php).\n\nThen change configs and run:\n\n```bash\nbin/xdebug-proxy --configs=/your/custom/path/config\n```\n\n### Extending\n\nAs mentioned [above](#factory-php) you can customize classes using your custom factory, which implements [`Factory\\Factory`](src/Factory/Factory.php). By default [`Factory\\DefaultFactory`](src/Factory/DefaultFactory.php) factory is used.\n\nThe most powerful are the request preparers. You can override `Factory\\DefaultFactory::createRequestPreparers()`. It  should return an array of objects which implement [`RequestPreparer\\RequestPreparer`](src/RequestPreparer/RequestPreparer.php) interface.\n\nRequest preparers will be called:\n- on request to ide from first to last\n- on request to xdebug from last to first\n\nYou can use request preparer for example for changing path to files (in break points and execution files).\n\nGood example of the request preparer is [`RequestPreparer\\SoftMocksRequestPreparer`](src/RequestPreparer/SoftMocksRequestPreparer.php). You can see its usage in [`Factory\\SoftMocksFactory`](src/Factory/SoftMocksFactory.php).\n\n### Using with soft-mocks\n\nFor soft-mocks you can use [`softMocksConfig`](softMocksConfig) config directory:\n```bash\nbin/xdebug-proxy --configs=/path/to/php-xdebug-proxy/softMocksConfig\n```\n\nIf you you want to provide path to custom `soft-mocks` init script, then copy [`softMocksConfig`](softMocksConfig) and change [`config.php`](softMocksConfig/config.php):\n```php\n...\n    'softMocks' =\u003e [\n        // if empty string, then vendor/badoo/soft-mocks/src/init_with_composer.php is used\n        'initScript' =\u003e '/your/custom/init-script.php',\n    ],\n...\n```\n\nFor more information see doc in [soft-mocks](https://github.com/badoo/soft-mocks/#using-with-xdebug) project.\n\n### Thanks\n\nMany thanks to [Eelf](https://github.com/eelf) for proxy example [smdbgpproxy](https://github.com/eelf/smdbgpproxy).\n\nThanks to [Dmitry Ananyev](https://github.com/altexdim) for help with docs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmougrim%2Fphp-xdebug-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmougrim%2Fphp-xdebug-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmougrim%2Fphp-xdebug-proxy/lists"}