Re: Re: PHP-CLI Debugging Question

From: Date: Tue, 15 Mar 2005 19:22:43 +0000
Subject: Re: Re: PHP-CLI Debugging Question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-210840@lists.php.net to get a copy of this message
No, I was looking for php to print each line of the code as it executes it. Jason Barnett wrote:
Davy Durham wrote:
Hi.. I'm working on converting some CLI (not CGI) bash scripts to php and was wondering if there's an equivalent to 'set -x' from bash in php set -x in bash basically causes the statements to be printed to stderr as they are executed. Does php have something similar? Thanks, Davy
I'm no expert on set -x, but you can easily have stdout go to a file if that's what you're after. You'll probably want to use the output buffering functions to do this. http://php.net/manual/en/ref.outcontrol.php <?php ob_start(); /** Put all of your PHP code here */ $stdout = ob_get_contents(); ob_end_clean(); file_put_contents('/path/to/file', $stdout); ?> -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins


« previous php.general (#210840) next »