I have Ubuntu 18.04 and a fresh installation of Laravel 8. I want to use Xdebug together with Sail. I followed the instructions as follows:
- Added
SAIL_XDEBUG_MODE=develop,debug
to env - Run
sail build --no-cache
andsail up -d
- Run
docker inspect -f {{range.NetworkSettings.Networks}}{{.Gateway}}{{end}} <container-name>
to get the IP of my docker container - Added
SAIL_XDEBUG_CONFIG="client_host=172.19.2.1"
to env (IP from step 3)
Next I continued with the instruction from PhpStorm for debugging:
- Validated that Xdebug is active by
sail php -v
. - Enabled listening to debug connection in PhpStorm
- Set a breakpoint and also enabled
Break at first line in PHP scripts
- Installed Xdebug Helper browser extension for Chrome
- Clicked on debug in extension (bug is now green)
- Refresh page, page builds very slowly, but loads completely (which should not be the case, it should hang on a breakpoint)
If I switch to PhpStorm, then no dialog pops up. However, according to the instructions, there should be some instructions.
Reload the page in the browser and return to PhpStorm. In the Incoming Connection From dialog, select the path mappings so that PhpStorm can map the remote files on the web server to the local files in your project.
What am I missing?