-
-
Save kzap/658d1dfe599aa4b3b3ca3e31339e18d2 to your computer and use it in GitHub Desktop.
Connect to XDebug running inside your PHP Container by building an image with XDebug installed and running like this: ```shdocker-compose -f docker-compose.yml -f docker-compose.xdebug.yml up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOCKER_HOST_IP=IP.OF.YOUR.HOST.MACHINE.FROM.INSIDE.DOCKER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM FROM php:7.0-apache | |
RUN pecl install xdebug | |
ARG HOST_IP | |
# set recommended PHP.ini settings | |
# see https://secure.php.net/manual/en/opcache.installation.php | |
RUN { \ | |
echo '[xdebug]'; \ | |
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)"; \ | |
echo 'xdebug.remote_enable=1'; \ | |
echo 'xdebug.remote_autostart=1'; \ | |
echo 'xdebug.remote_log="/tmp/xdebug.log"'; \ | |
echo "xdebug.remote_host=$HOST_IP"; \ | |
} > /usr/local/etc/php/conf.d/xdebug.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker-compose -f docker-compose.yml -f docker-compose.xdebug.yml up | |
version: '3.2' | |
services: | |
web: | |
image: your-container:xdebug | |
build: | |
context: . | |
dockerfile: Dockerfile.xdebug | |
args: | |
HOST_IP: "${DOCKER_HOST_IP}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment