Use ChromePHP to debug PHP
I recently started using ChromePHP to do all my PHP debugging and it is a life savor! It is a great way to debug PHP code on the fly, in Google Chrome. It's very easy to integrate to any project and log any errors, warnings, function outputs, etc.
PHP example code for ChromePHP:
include 'ChromePhp.php';
ChromePhp::log('hello world');
ChromePhp::log($_SERVER);
// using labels
foreach ($_SERVER as $key => $value) {
ChromePhp::log($key, $value);
}
// warnings and errors
ChromePhp::warn('this is a warning');
ChromePhp::error('this is an error');
Official site: http://www.chromephp.com
Chrome store link (free): https://chrome.google.com/webstore/detail/chromephp/noaneddfkdjfnfdakjjmocngnfkfehhd
Enjoy! :)
Written by Zach Reed
Related protips
4 Responses
For those not using Chrome i would suggest phpconsole.com. It too works the same way.
I used ChromePhp on Firefox for a while, after FirePHP stopped working. But now, although I'm loving Firefox Quantum, this new version of Firefox does not appear to support ChromePhp. I created QuantumPHP (https://github.com/frankforte/quantumphp) to get server logs into the browser and get on with my day - it appears to work on both Chrome and Firefox.
I also attempted to publish it on composer: frankforte/quantumphp. I hope it helps some others that prefer to develop with Firefox (especially now that it appears faster than Chrome).
ChromePhp can now be used in Firefox Quantum with this extension https://addons.mozilla.org/ro/firefox/addon/akta-logger/
ChromePHP does NOT work currently, but needs to badly. What are people using to debug PHP currently? :(