From 91da633b99b551c54ef8b56ddcb97d6418feeca7 Mon Sep 17 00:00:00 2001 From: kasteckis Date: Thu, 12 Jan 2023 18:48:52 +0200 Subject: [PATCH] Fix xdebug on Windows WSL --- .docker/Dockerfile | 18 ++++-------------- .docker/php/conf.d/xdebug.ini | 5 +++-- docker-compose.yml | 3 ++- public/index.php | 11 +++++++++++ 4 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 public/index.php diff --git a/.docker/Dockerfile b/.docker/Dockerfile index c9495e3..4427296 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -1,25 +1,15 @@ # Use image which contains apache with php -FROM php:8.1.2-apache +FROM php:8.2-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 # Install PHP extensions RUN docker-php-ext-install zip intl mysqli pdo pdo_mysql opcache -# Install NPM -RUN apt-get install npm -y -# Upgrade npm to latest version -RUN npm install -g npm -# Install node manager - n -RUN npm install -g n -# Install latest stable node version -RUN n stable -# Install latest stable Yarn -RUN npm install --global yarn # Install XDEBUG -RUN pecl install xdebug-3.1.3 && docker-php-ext-enable xdebug +RUN pecl install xdebug +# Enable XDEBUG +RUN 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 -RUN curl -sS https://get.symfony.com/cli/installer | bash && mv /root/.symfony/bin/symfony /usr/local/bin/symfony # Set umask to 0000 (newly created files will have 777 permissions) RUN echo "umask 0000" >> /root/.bashrc diff --git a/.docker/php/conf.d/xdebug.ini b/.docker/php/conf.d/xdebug.ini index 9c37b9c..27d5342 100644 --- a/.docker/php/conf.d/xdebug.ini +++ b/.docker/php/conf.d/xdebug.ini @@ -1,6 +1,7 @@ zend_extension=xdebug [xdebug] -xdebug.mode=develop,debug -xdebug.client_host=host.docker.internal +xdebug.mode=debug xdebug.start_with_request=yes +xdebug.client_port=9003 +xdebug.client_host=host.docker.internal diff --git a/docker-compose.yml b/docker-compose.yml index f86c138..f3caf9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3" +version: "3.8" services: mysql: image: mysql:8.0 @@ -11,6 +11,7 @@ services: MYSQL_PASSWORD: project ports: - "3306:3306" + phpmyadmin: image: phpmyadmin/phpmyadmin container_name: project_phpmyadmin diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..8da1d5d --- /dev/null +++ b/public/index.php @@ -0,0 +1,11 @@ +