How to configure xdebug with WAMP

If you're just debugging a local session using wampserver 3.0.6 and php 7.0.10 using xdebug, there's almost no need to edit your php.ini manually (more on that later).

You may activate xdebug.remote_enable from the tray icon menu. Having done so should yield something like the following output in php.ini (it's at the absolute end of the file):

; XDEBUG Extension
[xdebug]
zend_extension ="C:/wamp64/bin/php/php7.0.10/zend_ext/php_xdebug-2.4.1-7.0-vc14-x86_64.dll"
xdebug.remote_enable = On
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="C:/wamp64/tmp"
xdebug.show_local_vars=0

From there, the only thing you need to specifically add yourself (at least when using the php-debug extension in VS Code) to php.ini is:

xdebug.remote_autostart = 1

Don't forget to restart wampserver after that. If you need to connect remotely to another host, you would probably need som variation of (replace 127.0.0.1 with remote IP):

xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000

But that is pretty much outside the scope of my answer since that opens up a whole new can of worms IMHO


Follow instructions on http://xdebug.org/find-binary.php as Derick mentioned, but when configuring xdebug on Wampserver 3.0.0 I also had to add the following code to my php.ini.

xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=0
xdebug.profiler_output_dir = C:\wamp\tmp

for php 7 the configuration variables were renamed my final working configuration ended up like this:

   xdebug.mode = develop,debug,profile
   xdebug.start_with_request=yes
   xdebug.output_dir =c:/wamp64/tmp
   xdebug.show_local_vars = 1
   xdebug.log=c:/wamp64/logs/xdebug.log
   xdebug.log_level = 10
   xdebug.client_host=localhost
   xdebug.client_port=9000

please follow the instructions at http://xdebug.org/find-binary.php

cheers, Derick

Tags:

Xdebug

Wamp