server-side

Debugging server-side script using ChromePHP

I have been working for server and client side scripting,  whenever I got the issue in JavaScript used to debug in console or fire-bug based on the browser and extension.

But it’s not possible in server-side script, if you want server-side script to track a log entry in browser it won’t support. Chrome Logger have the feature to track the log entry in console for server-side script.

They support few platform to display the server-side scripting in console.

  1.  Install Chrome Logger from Google Chrome web store.
  2. Click the extension icon to enable logging for the current tab’s domain (It will light up blue).
  3. Include the ChromePHP file into your script.

Simple example which will log the script-side script into console.

Chrome.php

<?php include 'ChromePhp.php';

// simple function will return content.
function chromePHPExample() {
	return 'Welcome to ChromeLogger, you can see me in Google Chrome Console.';
}

// below function will display the content from the chromePHPExample function 
// print in Google Chrome console
ChromePhp::log(chromePHPExample());

ChromePHP have lots of logging method, you can also check below list. Continue reading…