Question

I'm looking for clean way to break my current habit of using print commands in PHP when I want to see what's happening.

I am aware of options such as Zend Debugger but I use Coda for development and I'm not interested in mixing other software or having to do server commands. I just need a console that can be added to my codebase and then turned on/off.

Does anything like this exist? Furthermore, what do you use and why?

EDIT: There was a lot of stuff out there but I needed something even simpler so I ended up coding it myself. It didn't take long (nor is it very pretty) but I've put it up on my server for anyone else interested.

Was it helpful?

Solution

You can use Xdebug in combination with any one of the many options available to view its debugging info.

OTHER TIPS

There is very good extension for Google Chrome - PHP Console.

There's FirePHP which will write your PHP log messages to the Firebug console.

I am aware of options such as Zend Debugger but I use Coda for development and I'm not interested in mixing other software or having to do server commands. I just need a console that can be added to my codebase and then turned on/off.

Not entirely sure if I understand you there, but couldn't you log to a file and then have a console window running with tail -f /path/to/log-file.txt? That works pretty well for me. Of course, you do need a console connection to the server for this.

Using Coda? That means you are using a mac. You probably want to look at XDebug and http://www.bluestatic.org/software/macgdbp/

There is another extension for Chrome available called ChromePHP. It's a little simpler than some of the other solutions:
https://chrome.google.com/webstore/detail/noaneddfkdjfnfdakjjmocngnfkfehhd

Getting started guide available at:
http://www.chromephp.com

During my development career i have not stumbled upon a software that displays the output you describe in your question. It would be a wonderful program or feature i believe but sadly i have not found any.

Like Andrew and nickf have answered, there are some good tools out there and until someone sits down and writes this, it looks like we are out in the cold.

I was looking for similar solution which wasn't heavy and even better I didn't need to include any classes, so I created simple function that outputs php to browser console, you can check it here:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top