Oct 11, 2016

A simple way to debug php apps

In certain PHP project, I have to work with a "hand made" framework (by other). There are many variables I want to know its value (for debugging). I really do not want to embed 3rd logging frameworks such as monolog. I use error_log (a built-in PHP function) for this task.
$str = "our message";
error_log(__FILE__. $str);
And we see result in /var/log/apache2/error.log (by default).
Reference: error_log PHP reference

No comments:

Post a Comment