- XAMPP for Windows: https://www.apachefriends.org/download.html
- Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019
If the file C:\xampp\php\ext\php_xdebug.dll
already exists, you can skip the download.
-
Download Xdebug for the specific PHP version:
- PHP 7.4 (64-Bit): https://xdebug.org/files/php_xdebug-2.9.7-7.4-vc15-x86_64.dll
- PHP 7.4 (32-Bit): https://xdebug.org/files/php_xdebug-2.9.7-7.4-vc15.dll
- PHP 7.3 (64-Bit): https://xdebug.org/files/php_xdebug-2.9.7-7.3-vc15-x86_64.dll
- PHP 7.3 (32-Bit): https://xdebug.org/files/php_xdebug-2.9.7-7.3-vc15.dll
- PHP 7.2 (32-Bit): https://xdebug.org/files/php_xdebug-2.9.7-7.2-vc15.dll
- PHP 7.1 (32-Bit): https://xdebug.org/files/php_xdebug-2.9.7-7.1-vc14.dll
- PHP 7.0 (32-Bit): https://xdebug.org/files/php_xdebug-2.6.1-7.0-vc14.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.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 :-)
- Use the PhpStorm bookmarklets generator to activate Xdebug from the browser side.
- Enable the Xdebug option: "Can accept external connections". See screenshot
- Change the Netbeans debugging options: https://user-images.githubusercontent.com/781074/39868196-c98f15a0-5458-11e8-8143-d8c44079e099.jpg
- Change the following key in php.ini:
xdebug.idekey="netbeans-xdebug"
- Installing XDebug on anything for VSCode in 5 minutes
- Install the PHP Debug Adapter for Visual Studio Code.
- Debug PHP In VSCode With XDebug
- Install the PHP Debugger for Brackets.
- Install the Xdebug Client Package
Enter cmd:
set XDEBUG_CONFIG="idekey=xdebug"
php test.php
Add XDEBUG_SESSION_START=PHPSTORM
as query parameter to the url, e.g.
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