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:
SAIL_XDEBUG_MODE=develop,debug
to envsail build --no-cache
and sail up -d
docker inspect -f {{range.NetworkSettings.Networks}}{{.Gateway}}{{end}} <container-name>
to get the IP of my docker containerSAIL_XDEBUG_CONFIG="client_host=172.19.2.1"
to env (IP from step 3)Next I continued with the instruction from PhpStorm for debugging:
sail php -v
.Break at first line in PHP scripts
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?
Thanks to the helps of @LazyOne I got it working. I just had to skip step 3 & 4 in my instructions.
Or in other words, I had to follow the instructions of https://laravel.com/docs/8.x/sail#debugging-with-xdebug but ignore the Linux Host IP Configuration
section, although I am on Linux. Looks like this section is not appropriate for Ubuntu?