Re: Capturing phpinfo()

From: Date: Wed, 24 Nov 2004 00:42:56 +0000
Subject: Re: Capturing phpinfo()
Groups: php.general 
Request: Send a blank email to php-general+get-202738@lists.php.net to get a copy of this message
> From: "Ashley M. Kirchner" <ashley@pcraft.com> > How can I stick phpinfo() at the bottom of a page in such a way that > it doesn't display the data in the page, but instead creates a log file > and dumps everything in there) The log file should either be appended > to every time, or if not, a unique one created every time (one per > transaction.) Is this even possible? Of course it's possible. Just fopen() a file at the end of the script, capture phpinfo() output with an output buffer (ob_start(), etc) and write it to the file. I can imagine the file getting very large very quick, though. Alternatively, you could put echo '<!-- ' . phpinfo() . '-->'; or ob_start(); phpinfo(); $phpinfo = ob_get_contents(); ob_end_clean(); echo "<!-- $phpinfo -->"; (from memory, so functions might be slightly different)... ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html

« previous php.general (#202738) next »