Articles Archive
Director Forums
Director Wiki
Job Board
Search
 
 Director Online WikiMain Page | About | Help | FAQ | Special pages | Log in | Printable version | Disclaimers

Debugging php message window style

From Director Online Wiki

Most php debugging can be done simply using 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 (requires a *nix environment):

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");

or use a text file for output:

exec("echo \"Some debug statement or $var\" >> debug.txt");

When the php executes, you can watch the output in your SSH session. (NOTE: Make sure you're tailing your fifo when the php runs otherwise it'll hang while php waits for you to read the output or just use a text file as mentioned.)

--CBT 13:17, 12 Oct 2005 (MDT)

Retrieved from "http://www.director-online.com/dougwiki/index.php/Debugging_php_message_window_style"

This page has been accessed 2479 times. This page was last modified 16:26, 30 May 2007.