Skip to content

Instantly share code, notes, and snippets.

@7rin0
Last active October 16, 2016 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7rin0/87345d7e55da8e83ed0843056f8404ed to your computer and use it in GitHub Desktop.
Save 7rin0/87345d7e55da8e83ed0843056f8404ed to your computer and use it in GitHub Desktop.
Debug PHP using Chrome Console

Install Chrome Logger for Chrome: https://chrome.google.com/webstore/detail/chrome-logger/noaneddfkdjfnfdakjjmocngnfkfehhd

Enable chrome extension on tab being tested (by clicking on Chrome Logger icon)

If you are using a framework based on Composer Autoload: composer --dev require ccampbell/chromephp

Else: include 'ChromePhp.php';

On the same tab open chrome dev tools: F12

Call log method from ChromePhp Class: \ChromePhp::log($_SERVER); \ChromePhp::log(kpr($test));

And the output is right on your console, juste like any javascript report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment