<p>This script tests your web server.</p>

<?php
$phpversion = phpversion();
if (!version_compare($phpversion, "4.1", "ge"))
{
 echo "PHP version ". $phpversion ." - <font color=#AA0000>fail: you need PHP 4.10 or higher</font><br>"; $failed .= '|||PHP|||'; 
}
else
{
 echo "PHP version ". $phpversion ." - <font color=#00AA00>pass</font><br>";
}
$mysqlversion = mysql_get_server_info();
if ($mysqlversion)
{
 echo "MySQL version ". $mysqlversion ." - <font color=#00AA00>pass</font><br>";
}
else
{
 echo "MySQL not detected - <font color=#AA0000>possible fail</font><br>"; $failed .= '|||MySQL|||'; 
}
if (function_exists("gd_info"))
{
 $gdinfo = gd_info();
 $gdworks = $gdinfo["GD Version"];
}
if ($gdworks != '')
{
 echo "GD version ". $gdworks ." - <font color=#00AA00>pass";
 if (!strstr($gdworks, '2.')) echo ", but GD 2.00+ is recommended for quality renderings.";
 echo "</font><br>";
}
else
{ echo "GD not installed - <font color=#AA0000>fail</font><br>"; $failed .= '|||GD|||'; }

if ($failed == '') $alltrue = true;
if ($alltrue) echo "<p>Congratulations, you can a full gallery without any problems.</p>";
else echo "<p>Some changes may need to be made before you can run a full gallery. Please note the suggested procedures below:</p>";

if (strstr($failed, '|||GD|||'))
 echo "<li> If you know that you have ImageMagick available on your server, do not worry about not having GD -- you only need one or the other, not both. If you do not have ImageMagick, then you will need to install it before you can use the thumbnail and image editing features of a full gallery. Most hosts should be willing to install ImageMagick on request if they do not already have it. If your host refuses, ImageMagick can also be installed on a shared account, it does not require root access as long as you have telnet access. Please see <a href=http://www.imagemagick.org>here</a> for instructions. <br><br>
Alternatively, you can ask your host to upgrade to PHP 4.3.0 or higher so that you will have GD available.<br><br>
";

if (strstr($failed, '|||PHP|||'))
 echo "<li> Please ask your web host to upgrade to a more recent version of PHP. Inform them that you need PHP 4.10 or better. (PHP 4.10 was released more than two years ago, so 95% of hosts should have updated by now.)<br><br>";

if (strstr($failed, '|||MySQL|||'))
 echo "<li> You need a database in order to use a full Gallery. MySQL is offered by most web hosts. If you know that you have MySQL, ignore this warning -- on some server setups the existence of MySQL simply can't be detected until a connection has been made to the database. A full gallery will run fine so long as you do have MySQL available, so this warning may be just a false alarm.<br><br>";

?>

