Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add XDebug config to support php debugging. #3818

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ services:
PUSHER_APP_ID: "${PUSHER_APP_ID:-coolify}"
PUSHER_APP_KEY: "${PUSHER_APP_KEY:-coolify}"
PUSHER_APP_SECRET: "${PUSHER_APP_SECRET:-coolify}"
PHP_IDE_CONFIG: "serverName=coolify"
volumes:
- .:/var/www/html/:cached
- ./docker/dev/xdebug.ini:/etc/php/current_version/fpm/conf.d/xdebug.ini:cached
- dev_backups_data:/var/www/html/storage/app/backups
postgres:
pull_policy: always
Expand Down
5 changes: 4 additions & 1 deletion docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ RUN apt-get update
RUN apt-get install postgresql-client-$POSTGRES_VERSION -y

# Coolify requirements
RUN apt-get install -y php8.2-pgsql openssh-client git git-lfs jq lsof
RUN apt-get install -y php8.2-pgsql openssh-client git git-lfs jq lsof php8.2-dev php-pear php-xml php8.2-xml
RUN apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

RUN pecl install xdebug

COPY --chmod=755 docker/dev/etc/s6-overlay/ /etc/s6-overlay/

COPY docker/dev/nginx.conf /etc/nginx/conf.d/custom.conf
Expand Down
7 changes: 7 additions & 0 deletions docker/dev/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[xdebug]
zend_extension=xdebug.so
xdebug.mode=debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start, but is also naive since it only supports debugging and not tracing or development helpers. I suggest this should be set to develop,debug for now, and develop,debug,trace once sane trace defaults are configured.

xdebug.start_with_request=yes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never do this. Allow the triggers to function as they should.

xdebug.client_host=host.docker.internal
xdebug.client_port=9000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely no reason to override the default. Since Xdebug 3, the default is 9003, for good reason (because 9000 conflicts with FPM and many other services).

xdebug.idekey=docker