ChromePHP setup for all your local sites

As you may kow you can output your PHP debugging into the Chrome console using ChromePHP. Hallelujah!

However, there is a 4k limit to the size of the output ChromePHP can return. Bugger. Therefore you need to use ChromePHP::useFile() in order to allow unlimited output. This works by outputting debugging content to somewhere on the filesystem and reading that output from a public URL such as http://localhost/chromephpoutput

I didn’t want to have to setup Apache every time I start developing a new site locally, eg;

http://localdevsite1/chromephp

http://localdevsite2/chromephp

http://localdevsite3/chromephp

etc…

So what you can do is simply add;

Alias /chromephp /tmp/chromephp

to your Apache config (say at /etc/apache2/conf.d/vhosts.conf) and for every domain that you host locally you’ll be able to access /tmp/chromephp via the URL http://somelocaldevsite12312/chromephp

Now, if you’ve put the ChromePHP lib on your include path and added;

ChromePHP:useFile('/tmp/chromephp', '/chromephp');

to that lib or anywhere else in your code, ChromePHP will now work for every site and for any amount of debugging output.

No Trackbacks

You can leave a trackback using this URL: http://www.tombh.co.uk/chromephp-setup-for-all-your-local-sites/trackback

4 Comments

  1. Judy Whiteside

    Any idea how to do this for Windows 7 using IIS? I get chromephp output if I use the browser to show http://localhost/chromephplogs/ I can see the raw file — the locations are ok.
    I have IIS set with virtual directory mapped to the physical location
    (virtual=chromephplogs, physical=c:/phpLogsChrome) …
    I use: ChromePhp::useFile(‘C:/phpLogsChrome’, ‘/chromephplogs’);

    But i do not see the output in the console. Something about the alias/shortcut I think, but I just can’t see it… Is this more than the IIS virtual->physical mapping??
    Thanks…

    Posted October 15, 2011 at 12:12 am | Permalink
  2. Hmm, sounds like you’ve set it up exactly right! Have you installed the Chrome extension? That’s an essential requirement you see.

    https://chrome.google.com/webstore/detail/noaneddfkdjfnfdakjjmocngnfkfehhd

    Posted October 17, 2011 at 5:53 pm | Permalink
  3. Judy Whiteside

    Yes I have the chrome extension. I was using chromephp just fine with output to the console until I had some that was too large. So I was trying to set up the useFile() arrangement. Ordinary chromephp::log() works fine. Currently I have finished debugging my large-debug-output problem, and so I’ve omitted the useFile() spec. But I’d sure like to know how to decipher this for Win7/IIS context. Thanks for any help.

    Posted October 22, 2011 at 8:45 pm | Permalink
  4. I’m at a loss then I’m afraid. I must say I’ve never used IIS and wouldn’t even know where to start debugging this. Sorry :(

    Posted October 24, 2011 at 10:41 am | Permalink

Post a Comment

Your email is never shared. Required fields are marked *

*
*