Last active
October 15, 2023 19:59
-
-
Save patricknelson/57ae24986cb13613314fb1f3c00a95d7 to your computer and use it in GitHub Desktop.
Revisions
-
patricknelson revised this gist
Oct 18, 2021 . 2 changed files with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ ; For PHP 5.6 and Xdebug 2 ; This file is intended to supplement the auto-generated "docker-php-ext-xdebug.ini" that gets created by the ; "docker-php-ext-enable xdebug" command. That ini file will contain the path to the dynamically built extension file ; (which is why they should remain separate). This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ ; For PHP 7 and Xdebug 3 ; This file is intended to supplement the auto-generated "docker-php-ext-xdebug.ini" that gets created by the ; "docker-php-ext-enable xdebug" command. That ini file will contain the path to the dynamically built extension file ; (which is why they should remain separate). [XDebug] ; General config ;xdebug.remote_enable = true ; Replaced by xdebug.mode=debug, see https://xdebug.org/docs/upgrade_guide and https://xdebug.org/docs/all_settings#mode xdebug.mode = debug xdebug.client_host = host.docker.internal xdebug.client_port = 9000 ; Profiling (enable via cookie or GET/POST variable: XDEBUG_PROFILE=1). xdebug.profiler_enable = 0 xdebug.profiler_enable_trigger = 1 xdebug.profiler_output_dir = /tmp/xdebug-profiling/ ; var_dump() settings. xdebug.cli_color = 1 -
patricknelson revised this gist
Mar 12, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Getting setup and running with Xdebug in a docker container these days is now fa ```Dockerfile # Installing Xdebug with PHP 7.3 images: RUN pecl install xdebug \ && docker-php-ext-enable xdebug ``` 2. Ensure the `remote_host` is referencing `host.docker.internal` (Docker for Windows or Docker for Mac circa 18.03 and later, see docs: [Windows](https://docs.docker.com/docker-for-windows/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host) and [Mac](https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host)) or `10.0.2.2` for VirtualBox when using Docker Toolbox. For example, here's part of my `xdebug.ini`: -
patricknelson renamed this gist
Sep 6, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
patricknelson renamed this gist
Sep 6, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
patricknelson renamed this gist
Sep 6, 2019 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
patricknelson revised this gist
Sep 6, 2019 . No changes.There are no files selected for viewing
-
patricknelson revised this gist
Sep 6, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,5 +27,5 @@ For more detailed example code, please see the files below! **Notes:** - These examples are very generic and should work in most of the [official PHP docker container images](https://hub.docker.com/_/php) for PHP 7.3 and below. However, starting with PHP 7.4, the `pecl` command will no longer be available. See: [Installing PHP extensions from source in your Dockerfile](https://olvlvl.com/2019-06-install-php-ext-source) - For Alpine linux variants, ensure that you have also installed [phpize](https://www.php.net/manual/en/install.pecl.phpize.php) (necessary for building PHP extensions). -
patricknelson revised this gist
Sep 6, 2019 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,6 +27,5 @@ For more detailed example code, please see the files below! **Notes:** - These examples are very generic and should work in most of the [official PHP docker container images](https://hub.docker.com/_/php) at for PHP 7.3 and below. However: Starting with PHP 7.4, the `pecl` command will no longer be available. See: [Installing PHP extensions from source in your Dockerfile](https://olvlvl.com/2019-06-install-php-ext-source) - For Alpine linux variants, ensure that you have also installed [phpize](https://www.php.net/manual/en/install.pecl.phpize.php) (necessary for building PHP extensions). -
patricknelson revised this gist
Sep 6, 2019 . 1 changed file with 10 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,9 @@ Getting setup and running with Xdebug in a docker container these days is now fairly simple and is composed of two main steps: 1. Ensure you've got XDebug installed and enabled in your PHP docker image, for example: ```Dockerfile # Installing Xdebug with PHP 7.3 images: RUN pecl install xdebug \ && docker-php-ext-enable xdebug \ ``` @@ -21,4 +22,11 @@ Getting setup and running with Xdebug in a docker container these days is now fa ;xdebug.remote_host = 10.0.2.2 ``` For more detailed example code, please see the files below! **Notes:** - These examples are very generic and should work in most of the [official PHP docker container images](https://hub.docker.com/_/php) - For Alpine linux variants, ensure that you have also installed [phpize](https://www.php.net/manual/en/install.pecl.phpize.php) (necessary for building PHP extensions). - Starting with PHP 7.4, the `pecl` command will no longer be available. See: [Installing PHP extensions from source in your Dockerfile](https://olvlvl.com/2019-06-install-php-ext-source) -
patricknelson revised this gist
Sep 6, 2019 . 2 changed files with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ FROM php:7.3-fpm-alpine # This example is extremely barebones and specific to Alpine linux, however in most containers at/below # php 7.3, you can just run pecl + docker-php-ext-enable (see below) after you've ensured that you have # also installed phpize (necessary for building PHP extensions). RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ # Important part: && pecl install xdebug \ This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ Getting setup and running with Xdebug in a docker container these days is now fairly simple and is composed of two main steps: 1. Ensure you've got XDebug installed and enabled in your PHP docker image, for example with PHP 7.3 images: ```Dockerfile RUN pecl install xdebug \ && docker-php-ext-enable xdebug \ -
patricknelson revised this gist
Sep 6, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ FROM php:7-fpm-alpine # This example is extremely barebones and specific to Alpine linux, however in most containers # you can just run pecl + docker-php-ext-enable (see below) after you've ensured that you have -
patricknelson revised this gist
Sep 6, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,4 @@ Getting setup and running with Xdebug in a docker container these days is now fa ;xdebug.remote_host = 10.0.2.2 ``` **Note:** These examples are very generic and should work in most of the [official PHP docker container images](https://hub.docker.com/_/php), especially if you've ensured that you have also installed [phpize](https://www.php.net/manual/en/install.pecl.phpize.php) (necessary for building PHP extensions). For more detailed example code, please see the files below! -
patricknelson revised this gist
Sep 6, 2019 . No changes.There are no files selected for viewing
-
patricknelson revised this gist
Sep 6, 2019 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,6 @@ Getting setup and running with Xdebug in a docker container these days is now fa RUN pecl install xdebug \ && docker-php-ext-enable xdebug \ ``` 2. Ensure the `remote_host` is referencing `host.docker.internal` (Docker for Windows or Docker for Mac circa 18.03 and later, see docs: [Windows](https://docs.docker.com/docker-for-windows/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host) and [Mac](https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host)) or `10.0.2.2` for VirtualBox when using Docker Toolbox. For example, here's part of my `xdebug.ini`: @@ -22,4 +21,4 @@ Getting setup and running with Xdebug in a docker container these days is now fa ;xdebug.remote_host = 10.0.2.2 ``` **Note:** These examples are very generic and should work in most of the [official PHP docker container images](https://hub.docker.com/_/php), especially if you've ensured that you have also installed phpize (necessary for building PHP extensions). For more detailed example code, please see the files below! -
patricknelson revised this gist
Sep 6, 2019 . 1 changed file with 20 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,20 +1,20 @@ ; This file is intended to supplement the auto-generated "docker-php-ext-xdebug.ini" that gets created by the ; "docker-php-ext-enable xdebug" command. That ini file will contain the path to the dynamically built extension file ; (which is why they should remain separate). [XDebug] ; Allow remote hosts to enable debugging, in this case connecting back to the automatically maintained DNS ; name referencing our workstation: host.docker.internal xdebug.remote_enable = true xdebug.remote_host = host.docker.internal xdebug.remote_port = 9000 xdebug.remote_handler = dbgp ; Profiling (enable via cookie or GET/POST variable: XDEBUG_PROFILE=1). xdebug.profiler_enable = 0 xdebug.profiler_enable_trigger = 1 xdebug.profiler_output_dir = /tmp/xdebug-profiling/ ; var_dump() settings. xdebug.overload_var_dump = 1 xdebug.cli_color = 1 -
patricknelson created this gist
Sep 6, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ FROM php:7-alpine # This example is extremely barebones and specific to Alpine linux, however in most containers # you can just run pecl + docker-php-ext-enable (see below) after you've ensured that you have # also installed phpize (necessary for building PHP extensions). RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ # Important part: && pecl install xdebug \ && docker-php-ext-enable xdebug \ # Clean up... && apk del .phpize-deps # Copy over our custom xdebug INI configuration which will coexist with the automatically generated # $PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini created by the "docker-php-ext-enable xdebug" command above. COPY ./xdebug.ini $PHP_INI_DIR/conf.d This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # Using Xdebug in Docker Getting setup and running with Xdebug in a docker container these days is now fairly simple and is composed of two main steps: 1. Ensure you've got XDebug installed and enabled in your PHP docker image, for example: ```Dockerfile RUN pecl install xdebug \ && docker-php-ext-enable xdebug \ ``` **Note:** This example is extremely generic and should work in most of the [official PHP docker container images](https://hub.docker.com/_/php), especially if you've ensured that you have also installed phpize (necessary for building PHP extensions). 2. Ensure the `remote_host` is referencing `host.docker.internal` (Docker for Windows or Docker for Mac circa 18.03 and later, see docs: [Windows](https://docs.docker.com/docker-for-windows/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host) and [Mac](https://docs.docker.com/docker-for-mac/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host)) or `10.0.2.2` for VirtualBox when using Docker Toolbox. For example, here's part of my `xdebug.ini`: ```ini ; Allow remote hosts to enable debugging, causing Xdebug to explicitly connect back to the workstation that Docker is running on. [XDebug] xdebug.remote_enable = true xdebug.remote_host = host.docker.internal ; Or, for workstations using Docker Toolbox (VirtualBox), use: ;xdebug.remote_host = 10.0.2.2 ``` Note that these examples are highly simplified. See files below for more detailed example code. This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ ; This file is intended to supplement the auto-generated "docker-php-ext-xdebug.ini" that gets created by the ; "docker-php-ext-enable xdebug" command. That ini file will contain the path to the dynamically built extension file ; (which is why they should remain separate). [XDebug] ; Allow remote hosts to enable debugging, in this case connecting back to the automatically maintained DNS ; name referencing our workstation: host.docker.internal xdebug.remote_enable = true xdebug.remote_host = host.docker.internal xdebug.remote_port = 9000 xdebug.remote_handler = dbgp ; Profiling (enable via cookie or GET/POST variable: XDEBUG_PROFILE=1). xdebug.profiler_enable = 0 xdebug.profiler_enable_trigger = 1 xdebug.profiler_output_dir = /tmp/xdebug-profiling/ ; var_dump() settings. xdebug.overload_var_dump = 1 xdebug.cli_color = 1