News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Phil Sturgeon's Blog:
Power dump() on your PHP applications
September 30, 2010 @ 11:04:03

Phil Sturgeon has a quick new post with a code snippet that could make your debugging life a bit simpler - a "dump" function that can give you a bit more information about your error than a standard var_dump.

When trying to work out what the hell is going wrong in your PHP application the first thing most of us start doing is madly start var_dump()'ing everything possible to work out where the problem is. var_dump() is fine, but by default it comes out in one line. So then we need to echo <pre> tags. Then we can't always see whats going on, especially if the background is black and bla bla bla so it goes on.

He mentions an alternative like XDebug, but that also requires access to install it on the server. His alternative, the "dump" function, catches the error, pulls out a backtrace of the path your script took to get there and echoes it out with the line number of the error and filename.

1 comment voice your opinion now!
debug snippet vardump backtrace


Derick Rethans' Blog:
PHP's segmentation faults GDB-fu
October 08, 2008 @ 09:32:09

Derick Rethans has shared a quick tip for locating a code crashing kind of problem with your application when something like XDebug isn't around.

However, because we as PHP developers are lazy, provide a few GDB tricks to make this easier. First of all, it's only really going to work if you haven't stripped the symbols from your PHP and Apache binaries. Secondly, you still need to have the PHP source lying around somewhere.

He suggests using GDB to run the backtraces and create a file to help you track down the infinite recursion problem that could be giving you issues.

0 comments voice your opinion now!
segfault gdb infinite recursion source backtrace


Pierre-Alain Joye's Blog:
How to generate backtraces on windows without compiler
June 11, 2007 @ 11:08:00

In a new tutorial posted to his blog today, Pierre-Alain Joye shows how to generate backtraces on a Windows machine without the need for a compiler installed.

How to get a back trace on windows without having to compile PHP has been an impossible task for many of us. The difficulty was to first succeed to compile php (given that you have a visual C++ installed). If you are in the middle of a bug hunting session, no need to say that setting up a windows build system is the last thing you like, especially if it is your first time. Thanks to Edin's window binary and MS Diagnostic Debug , it is now possible to have a backtrace in a couple of clicks.

To use the method you will need a few pieces of software to help out but all are available for free. Next up are the steps to get things set up (simple) and the creation of the backtrace to catch the error, complete with screenshots for the whole way. The end result is a nice, pretty error message output to the browser (Internet Explorer) that also dumps the backtrace for you to use.

0 comments voice your opinion now!
backtrace windows compiler debug diagnostic tool screenshot backtrace windows compiler debug diagnostic tool screenshot


J. Scott Johnson's Blog:
Your PHP Command of the Day - debug_backtrace()
April 12, 2006 @ 06:57:04

J. Scott Johnson shares, in this new blog post, about a handy little function that any PHP developer out there would do well to remember when it comes to debugging their code - debug_backtrace.

When you're massively and rapidly refactoring a code base, mere hours before a demo* and you utterly and completely hose yourself then just plain trot out debug_backtrace() and whammo! Your debugging problems go away!

This function generates a backtrace from the function it's inside, making it easy to tracke backwards the path that the data's taking to get to that location. Very handy for tracking down which functionality it is that's causing the issues...

0 comments voice your opinion now!
command day debug_backtrace generate backtrace command day debug_backtrace generate backtrace



Community Events





Don't see your event here?
Let us know!


introduction api interview install release series symfony laravel community list zendserver language update deployment framework opinion library package tips podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework