GithubHelp home page GithubHelp logo

How can I enable Xdebug? about docker-php-nginx HOT 2 CLOSED

rolka avatar rolka commented on September 22, 2024
How can I enable Xdebug?

from docker-php-nginx.

Comments (2)

C0mp4ct avatar C0mp4ct commented on September 22, 2024 1

You have to extend this image and make your own.

add this xdebug config in your build step:

.docker/php/conf.d/zz-xdebug.ini

zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.discover_client_host=true
xdebug.start_with_request=yes
xdebug.trigger_value=PHPSTORM
xdebug.log_level=0

xdebug.var_display_max_children=10
xdebug.var_display_max_data=10
xdebug.var_display_max_depth=10

xdebug.client_host=host.docker.internal
xdebug.client_port=9003

You have to copy this file to the /etc/php82/conf.d folder in build step:

Dockerfile:

FROM trafex/php-nginx:3.2.0

USER root

# Install composer from the official image
COPY --from=composer /usr/bin/composer /usr/bin/composer

ENV PHP_INI_DIR /etc/php82

RUN apk add --no-cache \
    bash \
    php82-iconv \
    php82-pecl-xdebug

RUN ln -s /usr/bin/php82 /usr/bin/php

# disable annoying logs
RUN sed -i '/\[supervisord\]/a loglevel=error' /etc/supervisor/conf.d/supervisord.conf && \
    sed -i 's/^;\?log_level = .*/log_level = error/' /etc/php82/php-fpm.conf

RUN mkdir -p /.composer; \
    chown -R nobody.nobody /.composer

USER nobody

#  custom php config
COPY .docker/php /etc/php82

from docker-php-nginx.

TrafeX avatar TrafeX commented on September 22, 2024 1

@C0mp4ct thank you for your example, I've added it to the documentation: https://github.com/TrafeX/docker-php-nginx/blob/master/docs/xdebug-support.md

from docker-php-nginx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.