14

Is any debugger is installed by default in XAMPP/WAMP server or We have manually download and configure the debugger? Also do recommend the best PHP debugger.

5
  • I don't have details, because I haven't done php in months, but you can try NetBeans, I believe it supports PHP debugging with XAMPP. Also supports PHPUnit very nicely too :) Commented Dec 7, 2011 at 16:10
  • @Zoidberg, yes NetBeans has a way to debug with xdebug and it can be configured/enabled in xampp. Commented Dec 7, 2011 at 16:13
  • 1
    When you say "the best debugger", are you willing to pay? As far as I know, Xdebug is the only free alternative. Commented Dec 7, 2011 at 16:15
  • @jlafay Sounds like it is something your currently using, you should put in an answer, you have a guaranteed upvote from me. Commented Dec 7, 2011 at 16:15
  • No I don't use Netbeans. Commented Dec 7, 2011 at 16:36

2 Answers 2

2

If you want to use Netbeans and Xampp with debugging, simply open c:\xampp\php\php.ini and add these rows. It worked for me like a charm.

xdebug.remote_handler="dbgp"
xdebug.remote_enable=on
xdebug.remote_port =9000
xdebug.remote_enable = 1
xdebug.profiler_enable = off
xdebug.profiler_trigger = off
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.profiler_output_dir = "C:\xampp\tmp"

Or check this out: Check this out: https://www.youtube.com/watch?v=HbJOP0YcSjs

Sign up to request clarification or add additional context in comments.

Comments

2
  • No debugger is installed by default in xampp
  • Yes, you've to manually configure it
  • Use Xdebug debugger

These steps worked for me. I'll describe my setup below

My setup: Win 10 Pro, XAMPP 7.3.33, IntelliJ IDEA

Summary

Summary - Installation

  1. Download xdebug DLL
  2. put some lines in php.ini
  3. Restart Apache

Summary - Usage

  1. Put a breakpoint in your code
  2. Start listening to debug connections on IntelliJ IDEA
  3. The debugger will pause at the line when that particular line gets invoked by the server

Details

All the details below have been taken from https://gist.github.com/odan/1abe76d373a9cbb15bed . All credit goes to them

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.

  • http://localhost?XDEBUG_SESSION_START=PHPSTORM

Follow me on Twitter | Blog

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.