docker-mac-vagrant icon indicating copy to clipboard operation
docker-mac-vagrant copied to clipboard

how to catch Xdebug connections?

Open kerstvo opened this issue 4 years ago • 1 comments

Hi! Thanks for this repository, it really makes my Mac breathe freely)

Have you ideas, how to catch debug connection in my IDE (phpstorm)?

kerstvo avatar Dec 18 '21 22:12 kerstvo

Hey Kirill,

While I havent used PHP in the past few months, I see no reason why it wouldn't work the same it normally does. Just forward the adequate ports to the host, and connect to it via PHPStorm.

For reference here are the settings I had used when I last did it:

# Install XDebug (Optional)
ARG XDEBUG_ACTIVE=0
RUN if [ "$XDEBUG_ACTIVE" -eq 1 ] ; then \
    yes | pecl install xdebug \
    && rm -rf /tmp/pear \
    && docker-php-ext-enable xdebug \
    && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.idekey=MYPROJECT-DEBUG" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    ; fi

markomitranic avatar Dec 29 '21 14:12 markomitranic