How to configure xdebug with WAMP
Asked Answered
S

5

19

I am using wamp 2.0 and trying to install XDebug extension for php. I have followed all steps written here http://wiki.netbeans.org/HowToConfigureXDebug#How_to_configure_xdebug_with_WAMP but still its not working.

Any suggestion how to fix this?

Sussman answered 3/1, 2012 at 12:41 Comment(2)
My WAMP (3.2.0 ) already have xdebugBombazine
watch video here youtu.be/jZBAlGUX9bIAnthocyanin
B
60

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

cheers, Derick

Brouhaha answered 11/1, 2012 at 18:37 Comment(7)
that is an extremely helpful websiteColombo
Have to say... I LOVE the fact here, that Derick - the guy who actually wrote Xdebug, actually answered the question. :)Showpiece
Watch that you don't grab the DLL suggested for one system and install it on another system (ie. 32 vs 64 bit) This caused problems for a few days with us...Crofoot
normally answers need to include a bit more info and a why to do this, this answer is one of the few that actually may not need more than a link, wow!Elis
Looks like this is an outdated answer - the link takes one to a wizard which doesn't really provide any additional info, other than asking one to paste phpinfo output in a wndow for analysis.Homestead
@TolaOdejayi after pasting the phpinfo details, the page will display the step-by-step.Divide
Had to jump in and say thank you from 2024.Dolhenty
D
11

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

Depart answered 9/2, 2017 at 23:40 Comment(0)
E
5

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
Electrophone answered 31/8, 2016 at 7:13 Comment(0)
W
2

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
Wakeup answered 29/3, 2022 at 7:56 Comment(1)
lifesaver, correct settings for php7, thanks!Confabulation
R
2

i'm using wamp server 3.3. in there debugger already installed. we need to do little thing to configure it.
step 1:

install xdebug helper extension to browser

step 2:- open php.ini file in both apache module and your-php-version-FCGI-CLI file.you can access these two files from wamp tray in php section
in there already [xdebug] lines there. under [xdebug] in **both** files add below lines and save. no need to add any other lines than below

xdebug.mode=develop,debug
xdebug.remote_autostart=1
xdebug.start_with_request=yes

step 3:- install php debugger extension in vs code. in debugger section listen to xdebugger. in xdebugger 3 default port is 9003

Reareace answered 9/8, 2023 at 6:5 Comment(1)
after 1 day of searching thats work for me . thanksBedbug

© 2022 - 2024 — McMap. All rights reserved.