From 600a6154b4b6bc19e584181763ffa3fadb8a87be Mon Sep 17 00:00:00 2001 From: Abdelrahman Omran Date: Sun, 24 Jun 2018 03:46:12 +0200 Subject: [PATCH] Automate xdebug installation and simplify instructions (#1630) --- DOCUMENTATION/content/documentation/index.md | 35 +++----------------- php-fpm/Dockerfile | 4 +++ workspace/Dockerfile | 4 +++ 3 files changed, 12 insertions(+), 31 deletions(-) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 54408fb..daf0bd5 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -277,44 +277,17 @@ docker-compose build workspace 1 - First install `xDebug` in the Workspace and the PHP-FPM Containers:
-a) open the `docker-compose.yml` file +a) open the `.env` file
-b) search for the `INSTALL_XDEBUG` argument under the Workspace Container +b) search for the `WORKSPACE_INSTALL_XDEBUG` argument under the Workspace Container
c) set it to `true`
-d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container +d) search for the `PHP_FPM_INSTALL_XDEBUG` argument under the PHP-FPM Container
e) set it to `true` -It should be like this: - -```yml - workspace: - build: - context: ./workspace - args: - - INSTALL_XDEBUG=true - ... - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_XDEBUG=true - ... -``` - -2 - Open `laradock/workspace/xdebug.ini` and `laradock/php-fpm/xdebug.ini` and enable at least the following configurations: - -``` -xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=0 -; NOTE: The dockerhost is your vEthernet (DockerNAT) IP -xdebug.remote_host=dockerhost -``` - -3 - Re-build the containers `docker-compose build workspace php-fpm` +2 - Re-build the containers `docker-compose build workspace php-fpm` For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm) or follow up on the next section if you use linux and PhpStorm. diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 82c82c5..e759a69 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -101,6 +101,10 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Copy xdebug configuration for remote debugging COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini +RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \ + sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \ + sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini + ########################################################################### # Blackfire: ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 60f63e3..c3154f5 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -238,6 +238,10 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # ADD for REMOTE debugging COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini +RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \ + sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \ + sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini + ########################################################################### # Blackfire: ###########################################################################