Skip to content

How to debug PHP code? #824

Discussion options

You must be logged in to vote

Here are some starting points for debugging source code:

  • Use a debugger. You are probably used to work with a debugger if you are coming from a programming language like C and C++. You can set break points in your source code, the software stops when it reaches a break point and shows the current variables. You can step trough you source code, line by line and see what happens. It's super comfortable, once you have a debugger set up in your favourite development environment. Have a look at this introduction video for Xdebug.

  • Use echo or similar PHP functions. We all do it from time to time. You can show variables on screen and/or the current web page. It's super quick and a decent too…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@PetersOtto
Comment options

Answer selected by PetersOtto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants