Skip to content

Instantly share code, notes, and snippets.

@asamofal
Created January 21, 2019 08:44
Show Gist options
  • Save asamofal/4cce7bb5b8ce48607e520dace9c82eb4 to your computer and use it in GitHub Desktop.
Save asamofal/4cce7bb5b8ce48607e520dace9c82eb4 to your computer and use it in GitHub Desktop.
How to setup xdebug for remote debugging
# install xdebug extension
apt install php-xdebug
# config xdebug
/etc/php/7.2/<fpm> or <apache2>/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 0
xdebug.remote_host = localhost
xdebug.remote_port = 9001
xdebug.max_nesting_level = 512
# open ssh session with port forwarding
ssh -R 9000:localhost:9000 <user>@<host>
# setup mapping in phpstorm
Settings => Languages and Frameworks => PHP => Servers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment