GD is a package for manipulating images with PHP. Often it is installed, but not always. This script shows you all possible information about your GD configuration.
The tutorial:
If you have manipulated images through PHP you have probably ran over the package GD. GD is a package that can be used through PHP if it's compiled with GD-support. Depending on what version of PHP you have, you might have different support for functions in GD. (GD can be read about here: http://www.boutell.com/gd/).
I have created a great function that you can use to see both IF you have support for GD on your server, and also what functions are enabled. Some versions don't have support for all image formats (gif, png, jpg etc) because of copyright problems I think. Sometimes you have TTF (True type format) support so you can use fonts via gd when manipulating images.
Run this function which is pretty straight forward to see what the status is for your GD :-)function
showGDinformation()
{
echo "GD support on your server: ";
// Check if the function gd_info exists (great way to know if gd is istalled)
if(function_exists("gd_info"))
{
echo "YES";
$gd = gd_info();
// Show status of all values that might be supported(unsupported)
foreach($gd as $key => $value)
{
echo "
" . $key . ": ";
if($value)
echo "YES";
else
echo "NO";
}
}
else
echo "NO";
}
{
echo "GD support on your server: ";
// Check if the function gd_info exists (great way to know if gd is istalled)
if(function_exists("gd_info"))
{
echo "YES";
$gd = gd_info();
// Show status of all values that might be supported(unsupported)
foreach($gd as $key => $value)
{
echo "
" . $key . ": ";
if($value)
echo "YES";
else
echo "NO";
}
}
else
echo "NO";
}
Basicly it checks if we have GD support by checking if the function gd_info() exist. It only does if you have the package. You will get a simple YES or NO in the output if you have support or not.
If you have support we get all gd-information via the function gd_info() and walk through it with foreach. Basicly I show all config values and after the name I show YES or NO.
from
http://www.999tutorials.com/tutoria...-on-server.html