after all this years galering with php debuging i finally manage to get xdebug working, it's the first day of my new dev lifegit add ressources/xdebug.conf.example git add ressources/xdebug.conf.example

This commit is contained in:
Bachir Soussi Chiadmi 2020-12-16 16:10:28 +01:00
parent c5757c47e2
commit 836e6586b8
7 changed files with 20 additions and 2 deletions

2
.env
View File

@ -12,3 +12,5 @@ DB_NAME=materio_d8
DB_LEGACY_NAME=materio_d7
DB_USERNAME=materio
DB_PASSWORD=materio
XDEBUG_CONF=./ressources/xdebug.conf

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ log/*
*.sql
bin/syncfiles.sh
solr_cores/*
ressources/xdebug.conf

View File

@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y \
mysql-client \
zip \
libzip-dev && \
cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini && \
# docker-php-ext-install -j$(nproc) iconv && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
apt-get install -y imagemagick libmagickwand-dev && \

View File

@ -1,4 +1,4 @@
PS1='\e[36m\e[1mPHP-7.0\e[0m:\e[90m\w\e[0m\n$ '
PS1='\e[36m\e[1mPHP-7.3\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

View File

@ -1,4 +1,4 @@
memory_limit = 2048M
memory_limit = 8192M
upload_max_filesize = 50M
post_max_size = 50M
max_execution_time = 150

View File

@ -79,18 +79,23 @@ services:
build: ./Docker/php/
expose:
- 9000
- 9001
user: ${USER_UID}:${USER_GID}
volumes:
- php-user-data:/home/${USER_UNAME}
- "${PROJECT_ROOT}:/var/www/html/d8.materio.com/public_html"
- "${LEGACY_ROOT}:/var/www/html/d7.materio.com/public_html"
- "${LOG_ROOT}/php:/var/log:rw"
- "${XDEBUG_CONF}:/usr/local/etc/php/conf.d/xdebug.ini"
working_dir: "/var/www/html/d8.materio.com/public_html"
networks:
- database
- redis
- server
- solr
# extra_hosts:
# - "host.docker.internal:192.168.144.4"
# - "testhost:192.168.0.21"
depends_on:
- mysql
- mysql-legacy

View File

@ -0,0 +1,9 @@
[xdebug]
xdebug.remote_enable=1
xdebug.remote_host=172.20.0.1 # Should use host.docker.internal but not working on linux
xdebug.remote_connect_back=0 # Not working on docker context
xdebug.remote_port=9001 # 9000 is already bound by php-fpm
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
xdebug.remote_log=/var/log/xdebug-error.log # Log file is mounted on volume so you can follow it