I find I can do most of my php debugging in a browser. But there are times when this is awkward (i.e. when building custom http headers). Here's a way to 'put' data to a consol window while your php executes. I'm sure you can do the same with perl.
SSH to your php directory and enter the following:mkfifo -m 772 .debug
tail -f .debug
Now in your php scripts direct debug messages to the debug FIFO with:exec("echo \"Some debug statement or $var\" > .debug");
When the php executes, you can watch the output in your terminal app. Tada! PHP debugging, message window style. You might even wrap it in a function called 'put'.
Have fun!
