PHP: normal old school debugger?

Possible duplicate:
PHP debugger selection

I want something like gdb or perl -d or pythons pdb for PHP. Is there such a thing?

PS NO XDEBUG!

+4
source share
3 answers

See my answer here for a similar question.

In the answer, I hilight how to use gdb for tracking through PHP specifically for how to analyze the failure, but you can use the same information for standard debugging.

This approach requires PHP to be configured with --enable-debug , linux machine Apache and a strong desire / ability to understand how the software works at a lower level.

  • Launch gdb using Apache :
    gdb /usr/lib/httpd
    • Then you have two options:
      • Launch apache as a server and upload the file through the browser, as usual:
        (gdb) run -X
      • Or use gdb to run the script itself:
        (gdb) run /path/to/the/script.php
    • For more information on gdb check out the quick link reference guide .

+2
source

Although there are some debuggers like the Zend IDE, I still think echo and print_r are the best debugger for PHP. And if you use frameworks like CakePHP, it provides some advanced debugging feature like debug() .

The lack of an interactive debugger is a big PHP problem.

0
source

valgrind does a great job of catching segfaults and debugging PHP code. I had success when PHP was not compiled with --enable-debug

0
source

Source: https://habr.com/ru/post/1437217/


All Articles