Re: PHP-CLI Debugging Question
| From: | Jason Barnett | Date: | Tue, 15 Mar 2005 15:19:57 +0000 |
| Subject: | Re: PHP-CLI Debugging Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-210795@lists.php.net to get a copy of this message | ||
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
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc