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

Images at DockerHub are built without xdebug support #75

Closed
whocaresk opened this issue Mar 20, 2019 · 3 comments
Closed

Images at DockerHub are built without xdebug support #75

whocaresk opened this issue Mar 20, 2019 · 3 comments
Labels

Comments

@whocaresk
Copy link

And there is no way to enable it during build. At this moment docs are misleading and make you think that putting PHP_ENABLE_XDEBUG=1 in .env or docker-compose file will really enable xdebug.

example Dockerfile:

FROM yiisoftware/yii2-php:7.3-apache

WORKDIR /app

COPY ./composer* ./

RUN composer install --ignore-platform-reqs && \
    mv vendor/bower-asset vendor/bower

COPY ./docker/config/000-default.conf /etc/apache2/sites-available/000-default.conf

COPY . .
version: '3.2'

services:
  backend:
    build:
      dockerfile: Dockerfile
      context: .
    ports:
    - 1337:80
    volumes:
    # Re-use local composer cache via host-volume
    - ~/.composer-docker/cache:/root/.composer/cache:delegated
    # Mount source-code for development
    - ./:/app
    - /app/vendor/
    environment:
    - PHP_ENABLE_XDEBUG=1

We can ensure that there is no files was created for xdebug (config, etc) by logging into created container and checking /etc/php/conf.d/xdebug.ini (there is no such file)

@samdark samdark added the type:bug Bug label Mar 20, 2019
@whocaresk
Copy link
Author

whocaresk commented Mar 21, 2019

Seems like there is problem with my configuration. I'll close issue. Phpstorm still doesn't receive connection, but trouble definitely is on my side
screenshot

@kristian-94
Copy link

@whocaresk I am getting this issue right now, my phpstorm looks just like that. Do you remember how you fixed it? Thanks

@whocaresk
Copy link
Author

@whocaresk I am getting this issue right now, my phpstorm looks just like that. Do you remember how you fixed it? Thanks

try this xdebug.ini:

;zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
;;; if you are on macOS, use host.docker.internal to identify the host machine, due to a network limitation on mac (https://docs.docker.com/docker-for-mac/networking/#port-mapping)
;;; otherwise find host ip
;;; xdebug.remote_host=host.docker.internal
;;; avoid standard port (9000) conflicts using 9005 port
xdebug.remote_port=9005
xdebug.idekey=PHPStorm

and put this line into your Dockerfile:
COPY ./path/to/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

don't forget to set PHP_ENABLE_XDEBUG=1 env var.
and path mappings also:
Снимок экрана от 2020-10-29 16-03-36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants