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.2.2, released on 2023-07-14 (supports PHP 8.0, 8.1 and 8.2)
  • Oldest supported version: 3.1.6, released on 2022-11-08 (supports PHP 7.2, 7.3, 7.4, 8.0 and 8.1)
  • Latest for 2.x branch: 2.9.8, released on 2020-09-28 (supports PHP 7.1, 7.2, 7.3, 7.4)
3472 questions
402
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
  • 6,143
  • 15
  • 46
  • 52
347
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
  • 54,664
  • 18
  • 108
  • 145
216
votes
11 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
  • 15,473
  • 7
  • 36
  • 47
150
votes
27 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
  • 3,466
  • 4
  • 27
  • 39
147
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
  • 6,108
  • 11
  • 51
  • 71
131
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
  • 5,165
  • 5
  • 37
  • 43
115
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
  • 22,714
  • 16
  • 72
  • 101
106
votes
13 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,297
  • 82
  • 198
  • 350
105
votes
9 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
  • 6,281
  • 4
  • 24
  • 42
91
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
  • 8,427
  • 9
  • 41
  • 57
73
votes
25 answers

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

I 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,680
  • 2
  • 25
  • 53
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
  • 891
  • 2
  • 8
  • 6
69
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,985
  • 6
  • 41
  • 52
67
votes
16 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
  • 1,532
  • 1
  • 14
  • 15
64
votes
12 answers

Xdebug for remote server not connecting

I want a team using different computers to be able to debug PHP on a remote server, but I am having a hard time getting Xdebug to work in NetBeans 7.0.1. I’ve tried many online tips, but to no avail. For the record, I have successfully installed…
Gruber
  • 4,478
  • 6
  • 47
  • 74
1
2 3
99 100