I have no idea how I managed to program in PHP for years without Xdebug. Now when an error occurs, it just pops up in my IDE, and I can set breakpoints and see ALL of the local variables including the ones set in the higher up scripts. It makes debugging sooooo much easier.

I feel kind of silly for not assuming a tool like this existed and hunting for it. I’ll never write a var_debug() again. I wonder what other absolutely vital tools are out there that I’m just completely oblivious to.

@Obscerno@lemm.ee
creator
link
fedilink
5
edit-2
1Y

I’m on Ubuntu, but from what I remember to get it working in my local environment I just:

  • Installed the module.
  • Added the following to the php.ini file:
    [xdebug]
    zend_extension=xdebug
    xdebug.mode = debug
    xdebug.start_with_request = yes
  • Restarted the apache server.
  • Installed the PHP Debug extension for Visual Studio Code.

And now I just hit F5 and select “Listen for Xdebug” and I’m ready to go.

You just saved thousands of php developers’ lives

Create a post

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



  • 1 user online
  • 1 user / day
  • 1 user / week
  • 1 user / month
  • 1 user / 6 months
  • 1 subscriber
  • 1.21K Posts
  • 17.8K Comments
  • Modlog