Title: Update README PHP setup with Xdebug · Issue #516 · vim-vdebug/vdebug · GitHub
Open Graph Title: Update README PHP setup with Xdebug · Issue #516 · vim-vdebug/vdebug
X Title: Update README PHP setup with Xdebug · Issue #516 · vim-vdebug/vdebug
Description: I went through the steps of installing xdebug and vdebug to debug my php setup and I couldn't, for the life of me get a debugger session working. I was getting the same error log over and over again: [60807] Log opened at 2022-10-20 12:1...
Open Graph Description: I went through the steps of installing xdebug and vdebug to debug my php setup and I couldn't, for the life of me get a debugger session working. I was getting the same error log over and over agai...
X Description: I went through the steps of installing xdebug and vdebug to debug my php setup and I couldn't, for the life of me get a debugger session working. I was getting the same error log over and over ...
Opengraph URL: https://github.com/vim-vdebug/vdebug/issues/516
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Update README PHP setup with Xdebug","articleBody":"I went through the steps of installing xdebug and vdebug to debug my php setup and I couldn't, for the life of me get a debugger session working. I was getting the same error log over and over again:\r\n\r\n```\r\n[60807] Log opened at 2022-10-20 12:14:47.026666\r\n[60807] [Step Debug] DEBUG: Found 'XDEBUG_CONFIG' ENV variable\r\n[60807] [Step Debug] INFO: Connecting to configured address/port: 127.0.0.1:9000.\r\n[60807] [Step Debug] INFO: Connected to debugging client: 127.0.0.1:9000 (through xdebug.client_host/xdebug.client_port). :-)\r\n[60807] [Step Debug] -\u003e \u003cinit xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"https://xdebug.org/dbgp/xdebug\" fileuri=\"{some_file_path}\" language=\"PHP\" xdebug:language_version=\"8.1.10\" protocol_version=\"1.0\" appid=\"60807\" idekey=\"xdebug\"\u003e\u003cengine version=\"3.1.5\"\u003e\u003c![CDATA[Xdebug]]\u003e\u003c/engine\u003e\u003cauthor\u003e\u003c![CDATA[Derick Rethans]]\u003e\u003c/author\u003e\u003curl\u003e\u003c![CDATA[https://xdebug.org]]\u003e\u003c/url\u003e\u003ccopyright\u003e\u003c![CDATA[Copyright (c) 2002-2022 by Derick Rethans]]\u003e\u003c/copyright\u003e\u003c/init\u003e\r\n\r\n[60807] [Step Debug] -\u003e \u003cresponse xmlns=\"urn:debugger_protocol_v1\" xmlns:xdebug=\"https://xdebug.org/dbgp/xdebug\" status=\"stopping\" reason=\"ok\"\u003e\u003c/response\u003e\r\n\r\n[60807] [Step Debug] WARN: 2022-10-20 12:14:47.028073: There was a problem sending 179 bytes on socket 6: Broken pipe.\r\n[60807] Log closed at 2022-10-20 12:14:47.028225\r\n```\r\n\r\nThere were 2 reasons:\r\n1. The VdebugSetupPHP section includes a helper script to start a debugging session:\r\n\r\n```bash\r\n#!/bin/bash\r\nexport XDEBUG_CONFIG=\"idekey=xdebug\"\r\n/usr/bin/php \"$@\"\r\n```\r\n\r\nhowerver, the [xdebug docs](https://xdebug.org/docs/step_debug#activate-debugger-cmd) also state that `XDEBUG_SESSION=1` should be set, otherwise the debug session doesn't seem to start. So the php-xdebug script should be:\r\n\r\n```bash\r\n#!/bin/bash\r\nexport XDEBUG_SESSION=1\r\nexport XDEBUG_CONFIG=\"idekey=xdebug\" # found out that this is not really needed\r\n/usr/bin/php \"$@\"\r\n```\r\n\r\n2. The VdebugSetupPHP section says that we should set our host_port to 9000, but as stated [here](https://bugs.xdebug.org/view.php?id=2017) (I honestly don't understand the why, yet) that is wrong, and should be on a port different than 9000 (like 9003, the default xdebug port) and in the `.vimrc` we'd need to add the following lines:\r\n\r\n```bash\r\nlet g:vdebug_options = {}\r\nlet g:vdebug_options[\"port\"] = 9003 # same as port defined for xdebug\r\n```\r\n\r\nnow, starting a debug session with `php-xdebug` works as expected :)","author":{"url":"https://github.com/shadydealer","@type":"Person","name":"shadydealer"},"datePublished":"2022-10-20T12:43:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/516/vdebug/issues/516"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2e7e6143-c75b-de15-2d81-f1198436c4df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 820A:37EFA8:904F6:B9AD6:698EC69A |
| html-safe-nonce | 4b6cb9d49479fa3a83744c661e0eb5ce7f59ca17b44b9420abfce10629e764af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjBBOjM3RUZBODo5MDRGNjpCOUFENjo2OThFQzY5QSIsInZpc2l0b3JfaWQiOiI3OTQyNTM5NDU3NDQ1NzQxMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 075f98615bbfc38bb483070d1daaf51dc42c16a0fe1b6de117acf50395720b2e |
| hovercard-subject-tag | issue:1416558693 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/vim-vdebug/vdebug/516/issue_layout |
| twitter:image | https://opengraph.githubassets.com/afdbcd47277c7dbec3f9a2d9d2acecaea1562cda742bd75ff2367c1d87ef3c0d/vim-vdebug/vdebug/issues/516 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/afdbcd47277c7dbec3f9a2d9d2acecaea1562cda742bd75ff2367c1d87ef3c0d/vim-vdebug/vdebug/issues/516 |
| og:image:alt | I went through the steps of installing xdebug and vdebug to debug my php setup and I couldn't, for the life of me get a debugger session working. I was getting the same error log over and over agai... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shadydealer |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| turbo-cache-control | no-preview |
| go-import | github.com/vim-vdebug/vdebug git https://github.com/vim-vdebug/vdebug.git |
| octolytics-dimension-user_id | 37241739 |
| octolytics-dimension-user_login | vim-vdebug |
| octolytics-dimension-repository_id | 4597834 |
| octolytics-dimension-repository_nwo | vim-vdebug/vdebug |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 4597834 |
| octolytics-dimension-repository_network_root_nwo | vim-vdebug/vdebug |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e6b91a7e6e46287d26887e3fb7a4161657bab8f7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width