Questions tagged [xdebug]

Xdebug is a PHP extension with developing aids, a profiler, an interactive debugging, and a code coverage information gatherer.

  • Homepage: https://xdebug.org/
  • Changelog: https://xdebug.org/updates
  • Latest stable version: 3.0.1, released on 2020-12-04 (supports PHP 7.2, 7.3, 7.4 and 8.0)
  • Latest for 2.x branch: 2.9.8, released on 2020-09-28 (supports PHP 7.1, 7.2, 7.3, 7.4)
3103 questions
403
votes
30 answers

How do you debug PHP scripts?

How do you debug PHP scripts? I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful. What is the best (in terms of fast and easy) way to debug in phpStorm or any other IDE?
Marcel
  • 5,739
  • 15
  • 43
  • 52
330
votes
7 answers

How to get xdebug var_dump to show full object/array

I am using xdebug (php_xdebug-2.1.2-5.3-vc9.dll) on WAMP. When I use var_dump on a large object or variable it does not show the full variable. array 'node' => array 'my_form' => array 'form' => array …
dm03514
  • 50,477
  • 16
  • 96
  • 131
202
votes
9 answers

How to trigger XDebug profiler for a command line PHP script?

XDebug offers the configuration directive xdebug.profiler_enable_trigger that allows to activate profiling by passing the GET or POST parameter "XDEBUG_PROFILE" when calling a script via HTTP. This is handy if you don't want profiling for ALL of…
selfawaresoup
  • 14,267
  • 7
  • 32
  • 45
141
votes
23 answers

Solution for "Fatal error: Maximum function nesting level of '100' reached, aborting!" in PHP

I have made a function that finds all the URLs within an html file and repeats the same process for each html content linked to the discovered URLs. The function is recursive and can go on endlessly. However, I have put a limit on the recursion by…
Rafay
  • 5,799
  • 10
  • 45
  • 69
130
votes
24 answers

How to disable XDebug

I think that my server became slow since I installed XDebug. So, in order to test my hypothesis I want to disable XDebug completely. I've been searching for tutorials on how to do this but I can't find such information.
Beto Aveiga
  • 2,931
  • 3
  • 23
  • 34
130
votes
3 answers

Increasing nesting function calls limit

There is one very bad limit in PHP: if you call some function a1() that calls a2(), that calls a3... so when a99() will call a100() you will see Fatal error: Maximum function nesting level of '100' reached, aborting! Is there any way to increase…
barbushin
  • 4,819
  • 4
  • 34
  • 41
106
votes
18 answers

Disabling xdebug when running composer

When running composer diagnose, I get the following error : The xdebug extension is loaded, this can slow down Composer a little. Disabling it when using Composer is recommended. How can I disable xdebug only when I'm running Composer?
greg0ire
  • 21,120
  • 15
  • 68
  • 95
93
votes
9 answers

Check if xdebug is working

Without installing a texteditor or an IDE, is it possible to test if xdebug is working, i.e. if it can debug php code? The only part xdebug comes up in phpinfo() is the following: Additional .ini files parsed /etc/php5/apache2/conf.d/mysql.ini, …
oshirowanen
  • 15,331
  • 77
  • 181
  • 330
80
votes
4 answers

How to stop xdebug from stopping on first line with PhpStorm?

I'm having this weird problem. All my settings used to work OK, until I updated my version of PHP. I use macports and have the php5 and php5-xdebug ports installed. xdebug is working, but it is stopping on the first line of my script even though I…
pocketfullofcheese
  • 6,563
  • 7
  • 38
  • 53
76
votes
5 answers

XDebug and RESTful server using PHPStorm or POSTman

How can I get a REST client (such as the one built into PHPStorm or POSTman) to work with XDebug? In my current set-up of XDebug, using PHPStorm and the Bookmarklet provided I'm able to get it working in both Chrome and Firefox - but as soon as I…
Daniel Hollands
  • 5,111
  • 3
  • 21
  • 36
72
votes
7 answers

Debugging php-cli scripts with xdebug and netbeans?

I have managed to initiate php-cli script debug session from the IDE itself, but I need to start the debugging session from the shell / command line. These are rather complex maintenance PHP scripts which take a lot of input parameters, so entering…
wurdalack
  • 871
  • 2
  • 8
  • 6
71
votes
23 answers

netbeans shows "Waiting For Connection (netbeans-xdebug)"

need help to configure xdebug, for debugging projects from IDE netbeans. These are the features of my components: XAMPP 1.8.2 PHP: 5.4.16 netbeans: 7.3.1 Apache: 2.4.4 (Win32) this is the final part of my php.ini file: [XDebug] zend_extension =…
pasluc74669
  • 1,610
  • 2
  • 21
  • 47
62
votes
11 answers

enabling xdebug remote debug makes apache server very slow

If I enable xdebug by settting xdebug.remote_enable=1, the apache server becomes very slow; once I change the setting to 0, it's normal. I found a same question here: XDebug really slow, but the answer isn't helpful. I didn't enable…
Will-i-Am-Davidon
  • 950
  • 1
  • 9
  • 15
60
votes
9 answers

How can I get XDebug to run with PHPUnit on the CLI?

I've tried running the following CLI command: phpunit -d xdebug.profiler_enable=on XYZTestCase.php but it just runs as normal. Can anyone point me in the right direction?? Thx! Here's the XDebug settings: xdebug xdebug support =>…
blacktie24
  • 4,697
  • 6
  • 37
  • 50
55
votes
1 answer

How do a read a xdebug profile in webgrind?

I have setup xdebug and webgrind and I have generated a profile so I can start improving the speed of my code execution. I have displayed the profile in webgrind but I haven't got a clue what any of it means. All the googling I have done doesn't…
David
  • 14,182
  • 34
  • 96
  • 150
1
2 3
99 100