First, install the Xdebug package from the testing repository.
$ apk add php7-xdebug --repository http://dl-3.alpinelinux.org/alpine/edge/testing/
Now edit the /etc/php7/php.ini
file and add the following to the end of it:
zend_extension=/usr/lib/php7/modules/xdebug.so
xdebug.coverage_enable=0
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.remote_log=/tmp/xdebug.log
xdebug.remote_autostart=true
With everything in place, we're ready to restart the server.
$ nginx -s reload
$ /etc/init.d/php-fpm restart
At this point, in PHPStorm, click "Run > Start Listening for PHP Debug Connections", and then "Run > Break at first line in PHP Scripts".
Now reload the site in the browser, making sure to use the port that goes directly to the server, which is sometimes :8080
instead of :80
, and you should see the debugger fire up.
Looks good on first glance, but some minor additions:
kill -s USR2 1
php --ini
to see which files are actually loaded and in which order.i still get
Failed loading /usr/lib/php7/modules/xdebug.so: Error relocating /usr/lib/php7/modules/xdebug.so: vspprintf: symbol not found
. though.