Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

Notice: You can also use the built-in Xdebug by using zend_extension = "C:\xampp\php\ext\php_xdebug.dll".

  • Move the downloaded dll file to: C:\xampp\php\ext

  • Open the file C:\xampp\php\php.ini with Notepad++

  • Disable output buffering: output_buffering = Off

  • Scroll down to the [XDebug] section (or create it) and copy/paste these lines:

[XDebug]
;zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
zend_extension = "c:\xampp\php\ext\php_xdebug-2.7.2-7.3-vc15-x86_64.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
;36000 = 10h
xdebug.remote_cookie_expire_time = 36000
  • Restart Apache

  • Click the Github ★ Star button :-)

PhpStorm

Netbeans

Eclipse

  • No comment

Visual Studio Code

Adobe Brackets

Sublime Text 2 and 3

@toubson

This comment has been minimized.

Copy link

commented Nov 11, 2016

Thanks. Very useful

@pdjkeelan

This comment has been minimized.

Copy link

commented Nov 20, 2016

Thank you, helped immensely 👍

@gvgvgvijayan

This comment has been minimized.

Copy link

commented Dec 2, 2016

Thank you!

@htxuankhoa

This comment has been minimized.

Copy link

commented Jan 6, 2017

Thank you! This helped me :)

@ghost

This comment has been minimized.

Copy link

commented Jan 13, 2017

Thanks!

@Ravita123

This comment has been minimized.

Copy link

commented Jan 13, 2017

thanks..its very helpful

@BruceGitHub

This comment has been minimized.

Copy link

commented Jan 25, 2017

not work!
no error but not stopping on breakpoint ...

@OssamaSelim

This comment has been minimized.

Copy link

commented Jan 25, 2017

not work!!
same problem of Bruce

@ghost

This comment has been minimized.

Copy link

commented Jan 25, 2017

Thanks.
very helpful.

@westy92

This comment has been minimized.

Copy link

commented Jan 30, 2017

I needed to add the line xdebug.remote_autostart = 1.

@TwitchBronBron

This comment has been minimized.

Copy link

commented Feb 1, 2017

Thanks! I wish I had a way of upvoting this! You should make a stackoverflow answer, and then I can upvote that!

@nataliaIv

This comment has been minimized.

Copy link

commented Feb 5, 2017

Thanks a lot!!!!!!!!!! Two days i can't install Xdebug!!! And I succeeded with your help!!!

@w3spi5

This comment has been minimized.

Copy link

commented Feb 6, 2017

Very good, thanks a lot !

@Iszeak

This comment has been minimized.

Copy link

commented Feb 12, 2017

Super, Thanks

@jpekeene

This comment has been minimized.

Copy link

commented Feb 14, 2017

Nice one, cheers

@MattBidas

This comment has been minimized.

Copy link

commented Feb 16, 2017

Thanks !!! Awesome !!!

@rioda78

This comment has been minimized.

Copy link

commented Feb 21, 2017

thanks very much

@grigore-94

This comment has been minimized.

Copy link

commented Feb 21, 2017

Thanks!

@TekkCraft

This comment has been minimized.

Copy link

commented Feb 22, 2017

Thanks! :D

@D4rkMindz

This comment has been minimized.

Copy link

commented Feb 22, 2017

Thank you :)

@dakn2005

This comment has been minimized.

Copy link

commented Feb 25, 2017

Thanks

@booncu

This comment has been minimized.

Copy link

commented Mar 24, 2017

Thank you :D

@guzzyman

This comment has been minimized.

Copy link

commented Mar 29, 2017

Hey Man, all I can say is. . .You ROCK! Thanks for this piece. I have never worked with a PHP IDE other than Dreamweaver. I needed an IDE and a tool I can use for debugging php code. I searched and found your tutorial. I opted for eclipse and I got the XDebug installed and configured according to your tutorial. Everything just went well without any errors. Once again, thanks a bunch!

@magcent

This comment has been minimized.

Copy link

commented Apr 8, 2017

Thanks bro. ur the best!!

@mootensai

This comment has been minimized.

Copy link

commented Apr 20, 2017

Thanks! Star 4 u!

@Giulia007

This comment has been minimized.

Copy link

commented Apr 27, 2017

Wow! It works! Thank you so much.

@gk2go

This comment has been minimized.

Copy link

commented Apr 30, 2017

Once I I launch php in the console, I get:
Failed loading c:\xampp\php\ext\php_xdebug-2.5.3-7.1-vc14-x86_64.dll

@poncianodiego

This comment has been minimized.

Copy link

commented May 2, 2017

@gk2go this is because you have downloaded the incorrect binary, first use the https://xdebug.org/wizard.php to figure out which binary you need to download. Then make sure to include your binary within the specified folder and make sure it matches the name.

@boomsya

This comment has been minimized.

Copy link

commented May 12, 2017

awesome! 👍 too easy like: press X to win

@CrawleyO

This comment has been minimized.

Copy link

commented May 15, 2017

AWesome

@SoboLAN

This comment has been minimized.

Copy link

commented May 16, 2017

Worked very nice for me.

However I can't seem to understand why it's not included by default in XAMPP, just like for older versions.

@Go-Noji

This comment has been minimized.

Copy link

commented Jun 2, 2017

Thanks!

@packo6300

This comment has been minimized.

Copy link

commented Jun 16, 2017

i need Xdebug for xampp V3.2.2 :/ text for php.ini

@cpekas

This comment has been minimized.

Copy link

commented Jun 17, 2017

thank you very much

@Micemade

This comment has been minimized.

Copy link

commented Jun 23, 2017

Big thanks (also thnx @poncianodiego for little additional help :) )

@bytecodeman

This comment has been minimized.

Copy link

commented Jul 2, 2017

Thank you!

@shovradas

This comment has been minimized.

Copy link

commented Jul 10, 2017

Thanks! It was handy!!!

@prakashdrupalcms8

This comment has been minimized.

Copy link

commented Jul 14, 2017

Thank you!

@PauloHenrique81

This comment has been minimized.

Copy link

commented Jul 17, 2017

Muitoo bom me ajudou muitooo!!!!!

@dydaniely

This comment has been minimized.

Copy link

commented Jul 21, 2017

i trusted https://xdebug.org/wizard.php and spend the all day , it is because it gave me wrong versionof dll .
Anyways you save my day , Good Job , Thanks

@WebDevBooster

This comment has been minimized.

Copy link

commented Jul 25, 2017

Very useful indeed!

@sanghisa

This comment has been minimized.

Copy link

commented Jul 26, 2017

Thank you ...

@kassius85

This comment has been minimized.

Copy link

commented Jul 30, 2017

Thank you very much!!!

@ouriels

This comment has been minimized.

Copy link

commented Aug 11, 2017

Hello all, do you know what is wrong in my configuration please ?
I followed this procedure, I have no errors but Netbeans don't stop at my breakpoints.

When I launch Debug in Netbeans, It wait connection:

capture

In log file (C:\xampp\tmp\xdebug.txt), I have this many times:

Log opened at 2017-08-11 08:39:31
I: Connecting to configured address/port: 127.0.0.1:9000.
E: Time-out connecting to client. :-(
Log closed at 2017-08-11 08:39:31

Here is my Netbeans config:

capture2

And part of my php.ini:

[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug-2.5.5-7.1-vc14.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log="c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
; 3600 (1 hour), 36000 = 10h
xdebug.remote_cookie_expire_time = 36000

I precise I use Symfony 3.3 application.

Thank you for your help !!

@hoangninh

This comment has been minimized.

Copy link

commented Aug 21, 2017

Amazing!! Thank you so much

@potapo

This comment has been minimized.

Copy link

commented Aug 29, 2017

cool,that's awesome

@ArnoldsK

This comment has been minimized.

Copy link

commented Aug 31, 2017

My lazy self says thanks!

@mariana-madrigal

This comment has been minimized.

Copy link

commented Sep 4, 2017

Thanks a lot!!!

@zeyizhou

This comment has been minimized.

Copy link

commented Sep 18, 2017

thanks

@elemes1

This comment has been minimized.

Copy link

commented Sep 24, 2017

Thanks a lot, for Laragon this didn't work at first, so I pointed the path to C:\laragon\bin\apache\httpd-2.4.27-win64-VC14\bin\php_xdebug-2.5.5-7.1-vc14-x86_64.dll Worked like Charm with your config.

Thanks

@n3omaster

This comment has been minimized.

Copy link

commented Sep 28, 2017

Thanks! Works excelent!

@GustavoJobstraibizer

This comment has been minimized.

Copy link

commented Sep 28, 2017

Thanks !

@odan

This comment has been minimized.

Copy link
Owner Author

commented Sep 30, 2017

@a1iraxa

This comment has been minimized.

Copy link

commented Oct 17, 2017

Great Work

@aliumarcdp

This comment has been minimized.

Copy link

commented Oct 25, 2017

Hi friends, I have latest PHP Version 7.1.9 and I have installed Apache server all are running fine. I am not able to configure Xdebug in eclipse environment. I am not getting Xdebug in php.ini after pasting php_xdebug-2.5.5-7.1-vc14.dll in D:\xampp\php\ext. Please guide me. I have environment Windows7, JDK, Eclipse, XAMP, Apache server all are running fine. What should I achieve it to configure Xdebug. Waiting for your response.

@khoimk

This comment has been minimized.

Copy link

commented Oct 28, 2017

Thanks so much. This has ended my 2 painful days 👍

@odan

This comment has been minimized.

Copy link
Owner Author

commented Oct 30, 2017

@aliumarcdp In case you have installed XAMPP on drive D: just change the drive letter from c: to d: in the php.ini [XDebug] section.

@bkarpov

This comment has been minimized.

Copy link

commented Nov 22, 2017

Thanks

@Abu3safeer

This comment has been minimized.

Copy link

commented Dec 3, 2017

Thank you very much.

@hossam131978

This comment has been minimized.

Copy link

commented Dec 3, 2017

thank you very much *************************

@enfrte

This comment has been minimized.

Copy link

commented Dec 4, 2017

Thanks, this worked on VS Code 1.18.1 - PHP 7.1. - XAMP 3.2.2

@yumarsoto19831

This comment has been minimized.

Copy link

commented Dec 16, 2017

Well done!!
Thank you very much. ;)

@Abu3safeer

This comment has been minimized.

Copy link

commented Dec 25, 2017

Waiting for PHP 7.2 version.

@DannyFeliz

This comment has been minimized.

Copy link

commented Jan 5, 2018

Worked like a charm 👍

@yashichiZX

This comment has been minimized.

Copy link

commented Jan 7, 2018

Thank you very much!!!

@saebifar

This comment has been minimized.

Copy link

commented Jan 8, 2018

very usefull

awesome :)

@Angelita31

This comment has been minimized.

Copy link

commented Feb 2, 2018

Hello all,
I am In my php.ini page and there isn't [XDebug] section, miy question is: Where I shoud paste it?
[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug-2.5.5-7.1-vc14.dll"
xdebug.remote_autostart = 1
xdebug.profiler_append = 0
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_log = "c:\xampp\tmp\xdebug.txt"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "c:\xampp\tmp"
;36000 = 10h
xdebug.remote_cookie_expire_time = 36000

Please I really appreciate your support!
Thanks in advance

@danielMensah

This comment has been minimized.

Copy link

commented Feb 10, 2018

me too I don't have any [XDebug] section. However I added it manually and still doesn't work.

@mak213k

This comment has been minimized.

Copy link

commented Feb 13, 2018

I've the same problem too. Would be in this part that i put my xdebug path?

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; ... or with a path:
;
; extension=/path/to/extension/msql.so
;
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
;
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+)
; extension folders as well as the separate PECL DLL download (PHP 5+).
; Be sure to appropriately set the extension_dir directive.
;
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

@mak213k

This comment has been minimized.

Copy link

commented Feb 13, 2018

I found the answer:

Put this line:
zend_extension=php_xdebug-2.6.0-7.1-vc14.dll

But the version of the xdebug should have the same of php installed in your machine. Look the version in this path:

/dashboard/phpinfo.php

phpinfo

Download the xdebug in this site:

https://xdebug.org/download.php

@nuwandharshana

This comment has been minimized.

Copy link

commented Feb 16, 2018

Yes, You need to add the code under dynamic extension category
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

@jandro935

This comment has been minimized.

Copy link

commented Feb 23, 2018

Thanks a lot !!

@viniciustaveira

This comment has been minimized.

Copy link

commented Feb 25, 2018

Sublime Text 2 and 3

@bhave-abhay

This comment has been minimized.

Copy link

commented Apr 24, 2018

I did not have the section [XDebug] either.
I added it, stopped and started Apache, and everything was good.

I haven't tried it, but I guess, if you restart Apache AFTER putting those dlls in ext dir and before changing the ini, it creates (an empty) section [XDebug]? Not sure.

But this was straight forward, and worked in first hit. Thanks a lot (y)

@zzsbebop

This comment has been minimized.

Copy link

commented May 6, 2018

Thanks, You made my day!

@clintonqwert

This comment has been minimized.

Copy link

commented May 8, 2018

Thank you!!

@MarkusL27

This comment has been minimized.

Copy link

commented May 9, 2018

Thanks, very helpfull!

@JulioCVaz

This comment has been minimized.

Copy link

commented Jun 17, 2018

very nice ! Thanks bro

@MartinMuzatko

This comment has been minimized.

Copy link

commented Jun 24, 2018

works perfectly - thanks~!

@atdesigntas

This comment has been minimized.

Copy link

commented Jun 29, 2018

Many thanks.

@NTsvetkov

This comment has been minimized.

Copy link

commented Jul 2, 2018

Thanks you! It's very helpful and easy.

Here are my 2 cents.

On some windows systems downloaded DLL has to be unblocked.

Don't forget to unblock it before or after copy to the ext folder!

image

@FellipePeixoto

This comment has been minimized.

Copy link

commented Jul 20, 2018

very thanks!

@saxsax1995

This comment has been minimized.

Copy link

commented Aug 1, 2018

If you guys get err cant stop apache, only need to restart the computer, and everything is going to work.
Thanks for the post by the way :D

@saschaende

This comment has been minimized.

Copy link

commented Aug 9, 2018

Thank you!!!!

@dacgray

This comment has been minimized.

Copy link

commented Aug 10, 2018

Thanks!

@alex-belyaev

This comment has been minimized.

Copy link

commented Aug 15, 2018

was needed to rename php_xdebug-2.5.5-7.1-vc14.dll to php_xdebug.dll , didn't work without it

@3ansh

This comment has been minimized.

Copy link

commented Oct 2, 2018

Just LOVE.

@guneyozsan

This comment has been minimized.

Copy link

commented Oct 14, 2018

Thanks for the last step. It didn't work until I clicked the Github ★ Star button: 👍

@gladius882

This comment has been minimized.

Copy link

commented Oct 24, 2018

Thanks a lot! Working with PHP 5.6 too

@fmbetancourt

This comment has been minimized.

Copy link

commented Oct 27, 2018

was needed to rename 'php_xdebug-2.5.5-7.1-vc14.dll' to 'php_xdebug.dll' , didn't work without it

Excellent!

@dunght163

This comment has been minimized.

Copy link

commented Nov 16, 2018

Thank and thank again! Very helpful and save my time when setting up xdebug for windows with xampp 👍

@Coder-Dan

This comment has been minimized.

Copy link

commented Dec 3, 2018

It would be better to link to xdebug downloads since you need to also ensure that xdebug DLL you download is compatible with the Thread Safe version of PHP or the Non-TS version of PHP.

Linked is here: https://xdebug.org/download.php

@nasseryacout

This comment has been minimized.

Copy link

commented Dec 23, 2018

Very Help full

Thanks man.

@swierczek

This comment has been minimized.

Copy link

commented Jan 2, 2019

https://gist.github.com/odan/1abe76d373a9cbb15bed#gistcomment-2636056

The comment from NTsvetkov about unblocking the .dll file on Windows was necessary to get it working for me. Good catch!

@MateuszMarciniak

This comment has been minimized.

Copy link

commented Jan 7, 2019

For everyone who uses NetBeans, Chrome and has their settings exactly the same as given by Odan and it's still not working...

Make sure that in your Project Properties in Browser category you have chosen Chrome instead of Chrome with NetBeans Connector.

You're welcome ;)

@ahmedali5530

This comment has been minimized.

Copy link

commented Jan 8, 2019

Once I I launch php in the console, I get:
Failed loading c:\xampp\php\ext\php_xdebug-2.5.3-7.1-vc14-x86_64.dll

Thanks you! It's very helpful and easy.

Here are my 2 cents.

On some windows systems downloaded DLL has to be unblocked.

Don't forget to unblock it before or after copy to the ext folder!

image

Thanks for your sharing, it took me 2 days figuring out what is the problem with this extension.

@iwanmcm

This comment has been minimized.

Copy link

commented Jan 8, 2019

Good job!

@marioskamperis

This comment has been minimized.

Copy link

commented Jan 9, 2019

Hello, what about php7.3?

@kanlukasz

This comment has been minimized.

Copy link

commented Jan 13, 2019

Hi, could you send instruction for php 7.3? There is a beta available. should it works?
I tried but not working
I have Win 7 64 bit, xampp 3.2.2

@PhoenixFnX

This comment has been minimized.

Copy link

commented Jan 24, 2019

@kanlukasz Agreed, the 7.3 beta build of xdebug dll doesn't work with 7.3 version of Xampp

@odan

This comment has been minimized.

Copy link
Owner Author

commented Jan 24, 2019

Xdebug 2.7.0 released!

@rafaelcavalcanti

This comment has been minimized.

Copy link

commented Mar 14, 2019

Thanks you! It's very helpful and easy.

Here are my 2 cents.

On some windows systems downloaded DLL has to be unblocked.

Don't forget to unblock it before or after copy to the ext folder!

image

This works for me. Thank You!

@odan

This comment has been minimized.

Copy link
Owner Author

commented Apr 8, 2019

Xdebug 2.7.1 is out!

@odan

This comment has been minimized.

Copy link
Owner Author

commented May 6, 2019

Xdebug 2.7.2 released! → https://xdebug.org/#2019_05_06

@trongnguyentcec

This comment has been minimized.

Copy link

commented Jun 3, 2019

For Netbeans 8 & PHP 7.1, 7.2, 7.3 please use these instructions: https://www.codewall.co.uk/debug-php-with-xdebug-on-netbeans/

@amindeist

This comment has been minimized.

Copy link

commented Jun 28, 2019

thank...very good

@HenkPoley

This comment has been minimized.

Copy link

commented Jul 16, 2019

@odan : For XAMPP Version 7.3.4 you need to download the (Zend) Thread Safe (TS/ZTS) version: https://xdebug.org/files/php_xdebug-2.7.2-7.3-vc15-x86_64.dll

Why they call it ZTS in one place, and TS in another 🤷‍♂️


btw, people can also use the built-in Xdebug by using zend_extension = "C:\xampp\php\ext\php_xdebug.dll" instead of the line above.

This actually works for me, while the version you point to doesn't.


I didn't need to unblock the DLL, even with Windows Defender on High+ cloud detection level ('Block At First Sight').

@azazqadir

This comment has been minimized.

Copy link

commented Aug 9, 2019

This process of install xdebug on windows based stack can be simpler if you use the xdebug installation wizard. To use the wizard tool create a PHP file and add this in the file

Now run this file in the browser and copy the details in the box and paste it in the wizard tool. Now, click Analyze my phpinfo() output button

Now you will some instructions, follow it and you are good to go.

Source: PHP debug process with xdebug

@nonew

This comment has been minimized.

Copy link

commented Aug 24, 2019

Can you help to figure out how to config in MacOS?

@free-developers

This comment has been minimized.

Copy link

commented Sep 5, 2019

Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.