Closed gosteev closed 3 years ago
Try adding PHP_IDE_CONFIG: "serverName=ShustDocker"
in docker-compose.dev.yml.
It's xdebug is not working out of the box, the above solution did not help it either. I am using php72-fpm2 if it matters.
Double check your PhpStorm settings..
The port must be the same configured in php.ini
Check the server address
as per the image in my previous message
Remember to enable xdebug
bin/xdebug enable
and check if it's enabled with bin/cli php -v
After adding this php ide config and chaning server name the xdebug started. Thanks for help. However this should work out of the box + steps from github or documentation should be updated.
I have the same problem, cant make xdebug work.
OS I have Ubuntu 20.04.1 LTS
I am trying to configure phpstorm for the remote PHP Remote Debug. I followed the configuration on the documentation, with no success, I also made the configuration from above but still nothing.
Here is my config.
What about your .yml file? And your php.ini config?
@vy-shmal On Linux don't forget about uncomment these two lines in docker-compose.dev.yml
Yes that was it! Thank you a lot @ssstankiewicz .
What about your .yml file? And your php.ini config?
Sorry @r-martins for the delay of the response, now I found time to reply.
php.ini is the default of the docker with xdebug enabled. the .yml was the default of docker
Here is the docker-compose.dev.yml with the solution above:
# (https://github.com/markshust/docker-magento)
#
# Version 34.2.0
version: "3"
services:
app:
volumes: &appvolumes
# Host mounts with performance penalty, only put what is necessary here
- ./src/app/code:/var/www/html/app/code:cached
- ./src/app/design:/var/www/html/app/design:cached
- ./src/app/etc:/var/www/html/app/etc:cached
- ./src/composer.json:/var/www/html/composer.json:cached
- ./src/composer.lock:/var/www/html/composer.lock:cached
- ./src/nginx.conf.sample:/var/www/html/nginx.conf:cached
#- ./src/auth.json:/var/www/html/auth.json:cached
#- ./src/m2-hotfixes:/var/www/html/m2-hotfixes:cached
#- ./src/patches:/var/www/html/patches:cached
#- ./src/var/log:/var/www/html/var/log:cached
#- ./src/var/report:/var/www/html/var/report:cached
# To sync your SSH to the container, uncomment the following line:
#- ~/.ssh/id_rsa:/var/www/.ssh/id_rsa:cached
# Linux only: remove the above lines and mount the entire src directory with:
- ./src:/var/www/html:cached
phpfpm:
volumes: *appvolumes
environment:
PHP_IDE_CONFIG: "serverName=ShustDocker"
# Linux only: host.docker.internal doesn't exist https://github.com/docker/for-linux/issues/264
# Uncomment two lines below & replace IP with result of: docker run --rm alpine ip route | awk 'NR==1 {print $3}'
extra_hosts:
- "host.docker.internal:172.17.0.1"
mailhog:
image: mailhog/mailhog
ports:
- "1025"
- "8025:8025"
# Disabling cron by default as it uses higher CPU, enable if needed
#cron:
# volumes: *appvolumes
Thank you for your time.
It appears this issue is resolved.
I initially created this repo for Mac, but since then 5 years has passed, and it has become popular on Linux as well. I'll try to improve the setup process for Linux users so more of this is automated. It could potentially also help out users on Windows WSL.
Closing this as it appears to be resolved/non-issue.
an issue is not resolved.
I tried adding PHP_IDE_CONFIG
and extra_hosts
to docker-compose file, triple-checked all the settings, still no luck :(
docker run --rm alpine ip route | awk 'NR==1 {print $3}'
prints 172.17.0.1
Reopening this issue for visibility.
Is anyone else having problems running Xdebug on Linux?
These lines within the docker-compose.yml file should do the trick:
...
phpfpm:
volumes: *appvolumes
environment:
PHP_IDE_CONFIG: "serverName=ShustDocker"
# Linux only: host.docker.internal doesn't exist https://github.com/docker/for-linux/issues/264
# Uncomment two lines below & replace IP with result of: docker run --rm alpine ip route | awk 'NR==1 {print $3}'
extra_hosts:
- "host.docker.internal:172.17.0.1"
...
Other than that, I'm not sure what else it could be. No other changes should be needed, so if you made any other changes I'd recommend backing them out.
Is anyone else having problems running Xdebug on Linux?
Yeah, still a problem for me on Ubuntu 20.04.1 and Docker version 20.10.2, build 2291f61.
The suggested changes above do not resolve this issue for me either. PhpStorm sits in a constant state of waiting for incoming connections.
This should be resolved on the latest images.
Is anyone else having problems running Xdebug on Linux?
Yeah, still a problem for me on Ubuntu 20.04.1 and Docker version 20.10.2, build 2291f61.
The suggested changes above do not resolve this issue for me either. PhpStorm sits in a constant state of waiting for incoming connections.
@pykettk Did you ever get this resolved?
@pykettk I think @niners52 & I resolved this issue. I'll be pushing out an update momentarily, but it has to do with extra_hosts and a DNS entry not setup for host.docker.internal.
This should be fully resolved in 41.0.2 https://github.com/markshust/docker-magento/blob/master/CHANGELOG.md#4102---2021-12-09
There is a new PHP image that should also expose port 9003, which may resolve some issues.
Hello! First of all, I want to thank you for this great docker configuration. I find it very handy and switched most of the projects I'm working on to it. However, I can't set up my debugger using this instruction: https://github.com/markshust/docker-magento#xdebug--phpstorm
Description Can't set up my debugger
Steps To Reproduce Go through the steps of this instruction https://github.com/markshust/docker-magento#xdebug--phpstorm
Expected Result PHPStorm will stop on the breakpoints
Actual Result PHPStorm is not stopping, I can see
waiting for incoming connections with ide key 'PHPSHORM'
text===
bin/cli php -v
output:PHP config:
PHP server:
Debug configuration:
Xdebug helper extension options:
Debug and DBGp Proxy ports are set to
9001
inside PHPStorm settings