Logging and debugging is an important task to do when developing an application or website. With logging, you can watch variables value, track where the bur/error occurred, and may other useful usage.
One of the best way to do logging and debugging in PHP is using FirePHP. The FirePHP website cover the basic usage of this library. This library can do many other advanced tasks. Read this post to find out the advanced things to do with FirePHP.
Beside for debugging, you can also use it to benchmark the PHP application. This is usefull to tweak you application.

