From b35d0fdd72f8bc1326f9fde875bc8170bc80ee77 Mon Sep 17 00:00:00 2001 From: Valentinas Kasteckis Date: Sat, 18 Dec 2021 13:49:50 +0200 Subject: [PATCH] upgrade xdebug 2 -> 3, update php to php 7.4.27 --- .docker/Dockerfile | 7 ++----- .docker/php/conf.d/error_reporting.ini | 1 + .docker/php/conf.d/xdebug.ini | 6 ++++++ README.md | 2 +- docker-compose.yml | 2 ++ 5 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .docker/php/conf.d/error_reporting.ini create mode 100644 .docker/php/conf.d/xdebug.ini diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 8a89d07..2eb709f 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,5 +1,5 @@ # Use image which contains apache with php -FROM php:7.4.16-apache +FROM php:7.4.27-apache RUN apt-get update && apt-get upgrade -y # Install packages needed to install php extensions RUN apt-get install git zlib1g-dev libxml2-dev libzip-dev zip unzip -y @@ -16,10 +16,7 @@ RUN n stable # Install sass compiler RUN npm install -g sass # Install XDEBUG -RUN pecl install xdebug-2.9.8 && docker-php-ext-enable xdebug -RUN echo 'xdebug.remote_port=9000' >> /usr/local/etc/php/php.ini -RUN echo 'xdebug.remote_enable=1' >> /usr/local/etc/php/php.ini -RUN echo 'xdebug.remote_connect_back=1' >> /usr/local/etc/php/php.ini +RUN pecl install xdebug-3.1.2 && docker-php-ext-enable xdebug # Install composer command RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer # Install symfony command diff --git a/.docker/php/conf.d/error_reporting.ini b/.docker/php/conf.d/error_reporting.ini new file mode 100644 index 0000000..7e566f4 --- /dev/null +++ b/.docker/php/conf.d/error_reporting.ini @@ -0,0 +1 @@ +error_reporting=E_ALL diff --git a/.docker/php/conf.d/xdebug.ini b/.docker/php/conf.d/xdebug.ini new file mode 100644 index 0000000..000cbb9 --- /dev/null +++ b/.docker/php/conf.d/xdebug.ini @@ -0,0 +1,6 @@ +zend_extension=xdebug + +[xdebug] +xdebug.mode=develop,debug +xdebug.client_host=192.168.2.1 +xdebug.start_with_request=yes diff --git a/README.md b/README.md index 79e3eb5..555c3c8 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Docker compose environment for Symfony (also works for Laravel or plain PHP) projects # Summary of what is included -* PHP 7.4.16 with XDEBUG 2.9.8 +* PHP 7.4.27 with XDEBUG 3.1.2 * Apache2 * MySQL 8.0 * PhpMyAdmin - manage MySQL diff --git a/docker-compose.yml b/docker-compose.yml index c4e135b..343d9a1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,8 @@ services: volumes: - ./:/var/www/html/ - ./.docker/virtualhost.conf:/etc/apache2/sites-available/000-default.conf + - ./.docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + - ./.docker/php/conf.d/error_reporting.ini:/usr/local/etc/php/conf.d/error_reporting.ini ports: - "80:80" depends_on: