Hello again, yesterday I tried to find the soluti...
# docker
c
Hello again, yesterday I tried to find the solution for the error that occurred. When I follow the tutorial to try and implement the personalized product page, I get the error that Class ‘PersonalizedProductDependecyProvider’ is not found. To resolve this problem I tried to install and configure xdebug for my docker setup. But I can’t get the connection to work. I tried the different troubleshooting options. When I execute this command nc -zv ${SPRYKER_XDEBUG_HOST_IP} 9000, I get an error that the connection is refused. I would be grateful for any advice about how to proceed from here
h
Hello David, What platform are you working on?
c
The docker container is on a unix system, I’m working on mac os where my php storm is running
h
I’ve used xdebug a bunch of times on my Mac. What is the value of SPRYKER_XDEBUG_HOST_IP?
c
The error message is: nc: connect to 10.101.65.96 port 9000 (tcp) failed: Connection refused
h
actually it should be ‘host.docker.internal’
But it seems our script to determinate the IP is wrong. Anyway we have a ticket to refactor xdebug in our docker SDK.
Try to change
docker/deployment/default/deploy
with
export SPRYKER_XDEBUG_HOST_IP=host.docker.internal
and then
docker/sdk restart -x
c
Ok after aplying the change im now getting this error nc: getaddrinfo: Name does not resolve
h
nc -zv host.docker.internal 9000
works?
Do you use docker-machine?
c
No that line leads to the same error. It is a virtual server machine I’m connecting to, to do my development
h
So it seems linux inside. The problem you need to solve - to determinate IP of your host and pass via SPRYKER_XDEBUG_HOST_IP. But how do you map your xdebug port to your dev machine?
c
Yes the server is a linux system. I followed this guide https://documentation.spryker.com/installation/spryker_in_docker/debugging-setup-in-docker-201907.htm to establish the connection between php storm and the server. By manually inserting my host ip in SPRYKER_XDEBUG_HOST_IP the connection is now established. But when debugging im still getting errors, that some remote files are not mapped to files in the project
Also for some reason the xdebug model is not shown when I execute php -m
h
you need to run
docker/sdk cli -x
to debug console commands
c
Ok now the module shows up. I’ve configured the mapping for the project files but not for the include paths, in PHPStorm. The debug doesn’t stop at any given breakpoint. I’m guessing it’s because a mapping is missing, but I’m unsure how to configure the mappings for the include paths. Thanks for your help so far
h
Glad to help
c
Can you point me to any information about how the path mappings in PHPStorm (Languages & Frameworks > PHP > Servers) are supposed to be configured? Especially the mappings for the include paths
I am not sure about
include
path. But the mapping is simple.
c
Yes I followed that guide and set up the mapping to /data. But I’m still getting the error
Copy code
Debug session was finished without being paused
			It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
And the execution is not stopped at the breakpoint I set
h
Just as experiment. Try
xdebug_break()
in any of entrypoint.
c
I think I fixed it. I synced the project files again and now it stops at the given breakpoints. Thanks for your patience
h
What do you use for syncing? docker-sync?
c
I synced the files via PHPStorms deployment configuration