cytopia / cytopia/devilbox

Xdebug on Devilbox (aggregated thread)

Open
#946 21 comments 0 reactions 1 assignee Claimed by @cytopia View on GitHub
Community help wanted discussion documentation xdebug
Dominant language
PHP
Stars
4.5k
Forks
652
PR merge metrics
No merged PRs in 30d

Description

Currently the Xdebug questions are separated in too many different issues, which makes it difficult to track. Let's consolidate them in here:

## Currently open Xdebug issues

These will be locked, but still contain good information

* #929
* #866
* #841
* #628
* #575
* #769

## Discord

Specific discussions can also be done in Discord.

* [Xdebug: General](https://discord.com/channels/1051541389256704091/1051548759621910559)
* [Xdebug: PhpStorm](https://discord.com/channels/1051541389256704091/1051566514198806708)
* [Xdebug: VSCode](https://discord.com/channels/1051541389256704091/1051566543701561344)
* [Xdebug: Sublime](https://discord.com/channels/1051541389256704091/1051817672461008936)

## Status

The documentation lacks behind and can not be updated at the momemnt as I don't have all the bits and pieces together. Let's find some common ground, so we can get this out of the way once and for all.

**:warning: Note:** This requires `Devilbox v3.0.0-beta-0.3` or later

The currently suggested Xdebug `php.ini` configuration for PHP 7.2 and above is as follows:

**file:** `./cfg/php-ini-X.Y/devilbox-php.ini`
```dosini
[PHP]
; Defaults
xdebug.mode = debug
xdebug.remote_handler = dbgp
xdebug.start_with_request = yes

; How to connect
xdebug.client_port = 9003
xdebug.client_host = host.docker.internal
xdebug.discover_client_host = false

; Logging
xdebug.log = /var/log/php/xdebug.log
xdebug.log_level = 7

; IDE Configuration
xdebug.idekey = PHPSTORM
;xdebug.idekey = VSCODE
```

Adding these two might also help:
```dosini
; https://www.php.net/manual/en/info.configuration.php#ini.max-input-time
; https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time
max_input_time = 0
max_execution_time = 0
```

**file:** `./cfg/php-fpm-X.Y/devilbox-fpm.conf` (copy `devilbox-fpm.conf-default`)
```dosini
...
[www]
; https://www.php.net/manual/en/install.fpm.configuration.php
request_terminate_timeout = 0
...
```

**Updates to the above config:**

* 2023-01-05: Changed `xdebug.client_port` from `9000` to `9003`
* 2023-01-05: Changed `xdebug.discover_client_host` from `0` to `false`
* 2023-01-06: Fixed typos in filename (thanks @Ernestopheles)

## Next Steps

We need confirmation for the following host operating system setups:

* Linux
* MacOS
* Windows (with WSL2)
* Windows (without WSL2)

And for the following IDE's

* PhpStorm
* VSCode
* Sublime

If Xdebug is working for you, please post the configuration in here as well as the OS and your IDE.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.