Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Xdebug enabled PHP container to match the production one #24

Open
DiegoPino opened this issue Feb 12, 2021 · 3 comments
Open

Update Xdebug enabled PHP container to match the production one #24

DiegoPino opened this issue Feb 12, 2021 · 3 comments
Assignees
Labels
esmero-php All that goes into the PHP container

Comments

@DiegoPino
Copy link
Member

What?

Our xdebug specific container is outdated and does not match in PHP version nor client utilities the one in production.

Also, we may want to adapt/change the way the IP address is exposed (host.docker.internal does not exist in Linux) by using something like:

http://www.paolostefan.it/en/post/phpstorm-linux-docker-xdebug/
@pcambra thanks!

Solution:

@DiegoPino DiegoPino self-assigned this Feb 12, 2021
@DiegoPino DiegoPino added the esmero-php All that goes into the PHP container label Feb 12, 2021
@pcambra
Copy link

pcambra commented Feb 12, 2021

Just to leave here the setup I've used to make it work:

    environment:
      - XDEBUG_CONFIG="remote_enable=1 remote_host=172.18.0.1 remote_autostart=1 discover_client_host=1"
      - PHP_IDE_CONFIG="serverName=docker-debug-server"

It is possible that the remote_autostart key would be enough, according to https://stackoverflow.com/questions/46263043/how-to-setup-docker-phpstorm-xdebug-on-ubuntu-16-04

But from the article above, the entrypoint could have something like:

#! / usr / bin / env bash
# entrypoint.sh
set -euo pipefail # quit on errors
export XDEBUG_CONFIG = "remote_host=$(ip route show | awk '/default/ {print $ 3}')"
exec "$ @" # execute the rest of the command line

It is also possible that the DBGp settings are required for PHPSTORM:

image

Related: how ddev will solve this (TBD): ddev/ddev#2117
Finally, his is the related issue in Docker: docker/for-linux#264

@patdunlavey
Copy link

I need this. Subscribing...

@DiegoPino
Copy link
Member Author

Partially Resolved via 08ce68a

We need to document what Pedro added to the environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
esmero-php All that goes into the PHP container
Projects
None yet
Development

No branches or pull requests

3 participants