Categories
Programming

Setting up xdebug with phpstorm

This guide provide a step by step details on how to set up phpstorm IDE to work with xdebug.

 

Installing on Ubuntu

In software search for xdebug and install.

 

Add to the following xdebug settings to php.ini file

 

xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode = req

 

 

 

Installing on Windows XAMPP

First download xdebug and copy it into the extension folder. Copy the full path the extension.

 

Add the following xdebug settings to php.ini file.

php.ini file

[XDebug]
zend_extension = "C:xamppphpextphp_xdebug-2.2.5-5.5-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_log="c:tmpxdebugxdebug.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.profiler_enable = 1
xdebug.profiler_output_dir ="c:tmpxdebug"

 

 

 

 

Install easiest xdebug for Firefox and specify the remote IDE key for Firefox

easiest_xdebug_ff

 

Then in the xdebug configuration apply following

phpstorm_xdebug

 

 

Put debug points and run the remote debug setting.

xdebug_option

 

 

enable the easiest debug and navigate the test page through the browser. Your debug point should be hit, the request url is reading the debug file.

 

Notes:

To stop breaking at the first line Untick Run->break and first lineā€¦