Showing posts with label remotedebug. Show all posts
Showing posts with label remotedebug. Show all posts

Thursday, 6 October 2016

PhpStorm XDebug configuration when using VM (Vagrant)

I would like to take notes how I did my set up of PhpStorm IDE for debugging with XDebug with the server running on VM (Vagrant). I assume that this configuration will work also for other type of environments where you need to use remote debugging.

Server configuration

At first you have to install XDebug (out of scope of this article).

On the vagrant machine we need kind of this configuration in /etc/php.ini
[xdebug]
zend_extension=/home/www/PHP/php-5.5.22/lib/php/extensions/xdebug.so
xdebug.max_nesting_level=9999
xdebug.profiler_output_dir=/tmp/
xdebug.profiler_output_name=xdebug-%p
xdebug.profiler_append=1
xdebug.profiler_enable_trigger=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=10.0.25.21
;xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.idekey="PHPSTORM"
xdebug.remote_autostart=1
xdebug.profiler_enable=0
xdebug.trace_options=1

Restart apache or php processes (depending on your server setup).

Important settings are: remote_host, idekey, remote_enable, remote_autostart