PDA

View Full Version : How to show PHP installation specs?


heliosw
01-26-2004, 04:37 PM
Really simple question; I should know the answer to this already, and someone showed me previously but I forgot...

How can you show the installation specs for PHP from your site? I think there's a short little string that you type after your web address to get the specifics of PHP components and settings installed on the server.

Can anyone refresh my memory?

thanx,

steve

TomD
01-26-2004, 05:08 PM
Cut and paste the following into a text file named infophp.php (or something like that):<?PHP
phpinfo();
?>

If you want to see the php.ini settings:<?php
/*
* 12/03/2003
* This code is from the www.php.net WEB site
* in the user comment section of the manual page for ini_get_all()
* at : http://www.php.net/manual/en/function.ini-get-all.php
* by : Don Maciejewski - webmaster - http://insideouttattoo.com
*/

$a= ini_get_all(); //Call ini_get_all()
$output="<table border=1>"; //Start an output string
while(list($key, $value)=each($a)) //Loop through results
{
list($k, $v)= each($a[$key]); //Access each array
$output.="<tr><td>
$key
</td><td>
$v
</td><td>
$k
</td></tr>"; //Build output
}//while
$output.="</table>"; //Finish up
echo $output; //Spit it all out
?>

Point your browser to the file once you have it saved:
www.yourdomain.com/infophp.php and stand back.

heliosw
01-26-2004, 05:15 PM
Originally posted by TomD
[B]Cut and paste the following into a text file named infophp.php (or something like that):<?PHP
phpinfo();
?>
...

I knew it was something simple like that. THanks for the tip!

:-)

steve