diff --git a/README.md b/README.md index 16644ba..0aaeb1b 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,11 @@ You can access Nginx and Symfony application logs in the following directories o You can also use Kibana to visualize Nginx & Symfony logs by visiting `http://symfony.localhost:81`. +# Use xdebug! + +To use xdebug change the line `"docker.host:127.0.0.1"` in docker-compose.yml and replace 127.0.0.1 with your machine ip addres. +If your IDE default port is not set to 5902 you should do that, too. + # Code license You are free to use the code in this repository under the terms of the 0-clause BSD license. LICENSE contains a copy of this license. diff --git a/docker-compose.yml b/docker-compose.yml index 5887cfa..dd28137 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,6 +18,8 @@ services: - ./logs/symfony:/var/www/symfony/var/logs:cached links: - db + extra_hosts: + - "docker.host:127.0.0.1" nginx: build: ./nginx ports: diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 904a7ea..8eb1297 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -26,6 +26,7 @@ RUN apk add --update \ php7-tokenizer \ php7-session \ php7-simplexml \ + php7-xdebug \ make \ curl @@ -35,10 +36,11 @@ RUN curl --insecure https://getcomposer.org/composer.phar -o /usr/bin/composer & ADD symfony.ini /etc/php7/php-fpm.d/ ADD symfony.ini /etc/php7/cli/conf.d/ +ADD xdebug.ini /etc/php7/conf.d/ ADD symfony.pool.conf /etc/php7/php-fpm.d/ CMD ["php-fpm7", "-F"] WORKDIR /var/www/symfony -EXPOSE 9000 +EXPOSE 9000 \ No newline at end of file diff --git a/php-fpm/xdebug.ini b/php-fpm/xdebug.ini new file mode 100644 index 0000000..70a7ea9 --- /dev/null +++ b/php-fpm/xdebug.ini @@ -0,0 +1,6 @@ +zend_extension=xdebug.so + +[Xdebug] +xdebug.remote_enable=true +xdebug.remote_port=5902 +xdebug.remote_host=docker.host \ No newline at end of file