Re: Capturing phpinfo()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: "Ashley M. Kirchner" <ashley@xxxxxxxxxx>
>     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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux