1

I have a problem debugging PHP with PhpStorm. I have container, and it is running Ubuntu 18.04.2 LTS and my host machine is macOS 10.14.5. I added configuration to PhpStorm, but breakpoint is not hit.

So, this is my xdebug.ini configuration:

zend_extension=xdebug.so
xdebug.max_nesting_level = 250
xdebug.remote_port = 9000
xdebug.idekey = "XDEBUG_ECLIPSE"
xdebug.remote_host = "192.168.1.144"
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.var_display_max_depth = -1

#  Enable the debugging on request
xdebug.remote_enable = on
xdebug.remote_autostart = off

# enable logging
xdebug.remote_log=/tmp/xdebug.log

When I run php -m -v, I can see under Zend Modules that Xdebug is enabled/installed. My php version is PHP 7.1.32.

192.168.1.144 is the IP of my host machine. I also checked that PhpStorm is configured to listen on port 9000

Xdebug settings

When I created new configuration, I set IDE key(session id) as XDEBUG_ECLIPSE, also, when I defined server under configuration, host is correct (dummy.test), port is set to 80, and Debugger is set to Xdebug.

I also ran command tail -f /tmp/xdebug.log, and when I refreshed the page, there wasn't any new entry in the log file.

Any idea what am I missing? I set up breakpoint to one index function of xy controller and is not hit, I also enabled break at first line in PHP script.

phpinfo

14
  • can you please add Dockerfile? Commented Oct 23, 2019 at 8:23
  • phpstorm is not detecting the ip Commented Oct 23, 2019 at 8:23
  • @myxaxa docker file is actually quite big (work project), if you could tell me what precisely would you like to see, I will be happy to show it. This is output of docker ps command: 9771a8a1bad2 core_dev:0.1.12 "docker/php-apache/f…" About an hour ago Up About an hour (healthy) 80/tcp, 4750/tcp core Commented Oct 23, 2019 at 8:28
  • 1
    yes yes yes...it is working. apperently host.docker.internal resolved to different ip (192.168.65.2), when I added that entry to my host file, it started working. Please, post some summary as a answer and I will accept it. Thank you! Commented Oct 23, 2019 at 9:04
  • 1
    @golobich probably it's pointing on docker bridge ip. but I never used Mac. so someone with better experience should help :) glad it helped you! Commented Oct 23, 2019 at 9:09

1 Answer 1

1

so, with help of the topic owner it was found that for Mac host.docker.internal is set doc

as a hack-solution host ip was added to /etc/hosts inside docker container: host-ip host.docker.internal

probably there should be a better solution :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.