Skip to content
This repository was archived by the owner on Apr 19, 2026. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all 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
13 changes: 9 additions & 4 deletions bin/xdebug-on.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

set -e

docker-php-ext-enable xdebug
pkill -o -USR2 php-fpm
touch /app/.xdebug-enabled
echo "Xdebug enabled"
if [ ! -e /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini ]; then
docker-php-ext-enable xdebug
echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
pkill -o -USR2 php-fpm
touch /app/.xdebug-enabled
echo "Xdebug enabled"
else
echo "Xdebug already enabled"
fi
5 changes: 1 addition & 4 deletions php.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
xdebug.remote_enable = 1
xdebug.remote_autostart = 0
xdebug.remote_connect_back = 0
Comment on lines -1 to -3

@pierlon pierlon Feb 8, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These are all now redundant since Lando provides these equivalent config vars by default via the XDEBUG_CONFIG environment var (client_host, discover_client_host, remote_enable and remote_enable).

xdebug.remote_port=9000

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The default remote port for XDebug 3 is now 9003.

html_errors = 1
xdebug.start_with_request = yes

@pierlon pierlon Feb 8, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With this being set to true, XDebug profiling is started with every request. The other option would be to enable profiling on trigger, but that requires either setting an environment variable (XDEBUG_TRIGGER), $_GET or $_POST variable, or via cookie (see the docs).