Skip to content

Instantly share code, notes, and snippets.

@odan
Last active October 19, 2024 04:15
Show Gist options
  • Save odan/1abe76d373a9cbb15bed to your computer and use it in GitHub Desktop.
Save odan/1abe76d373a9cbb15bed to your computer and use it in GitHub Desktop.
Installing Xdebug for XAMPP

Installing Xdebug for XAMPP with PHP 7.x

Requirements

Setup

If the file C:\xampp\php\ext\php_xdebug.dll already exists, you can skip the download.

[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
;zend_extension = "c:\xampp\php\ext\php_xdebug-2.9.7-7.4-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

Visual Studio Code

Adobe Brackets

Sublime Text 2 and 3

Start debugger from the console

Enter cmd:

set XDEBUG_CONFIG="idekey=xdebug"
php test.php

Postman

Add XDEBUG_SESSION_START=PHPSTORM as query parameter to the url, e.g.

Follow me on Twitter | Blog

@nileshp9495
Copy link

Thanks. Very useful

@zericksp
Copy link

zericksp commented Apr 1, 2021

Great. Finally I can use Xdebug at VS Code!

@paresh-developer
Copy link

How should we go for IIS debug ???

@os3albert
Copy link

Thank You Man!!! 😇 🤓 ❤️

@webrefer
Copy link

thank you

@vukasinpetrovic
Copy link

vukasinpetrovic commented Oct 15, 2021

Awesome, thank you! ❤️

@wordpressyu
Copy link

a tutorial like this ,
should be for wamp server.
when wordpress is installed on wamp ,
what neccessry confugurations of wamp should be done ?
thnks

@ElvisAns
Copy link

ElvisAns commented Feb 24, 2022

It works but you are commenting the name of the downloaded file
instead of
zend_extension = "c:\xampp64\php\ext\php_xdebug.dll"
;zend_extension = "c:\xampp64\php\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll"
i used

;zend_extension = "c:\xampp64\php\ext\php_xdebug.dll"
zend_extension = "c:\xampp64\php\ext\php_xdebug-2.9.7-7.4-vc15-x86_64.dll"

@amirdora
Copy link

amirdora commented Sep 9, 2022

Thank you for adding links here, on PECL doesn't seem to be available for php 7.4.

@zulfirman
Copy link

zulfirman commented Nov 2, 2023

For Xdebug version 3 use this config in php.ini

[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
xdebug.mode=debug
xdebug.start_with_request=yes
xdebug.profiler_append = 0
;xdebug.profiler_output_dir = "c:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_handler = "dbgp"
xdebug.client_host = "127.0.0.1"
xdebug.log = "c:\xampp\tmp\xdebug.txt"
xdebug.client_port = 9000
xdebug.output_dir = "c:\xampp\tmp"
;36000 = 10h
xdebug.remote_cookie_expire_time = 36000

https://xdebug.org/docs/upgrade_guide#changed-xdebug.profiler_enable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment