What version of PHP and GD library is required for jpgraph to function properly?

To ensure that jpgraph functions properly, it requires PHP version 5.1.0 or higher and the GD library version 2.0.28 or higher. If you are experiencing issues with jpgraph, make sure that your PHP version meets the minimum requirement and that the GD library is installed and enabled on your server.

// Check PHP version
if (version_compare(PHP_VERSION, '5.1.0', '<')) {
    die('Error: jpgraph requires PHP version 5.1.0 or higher');
}

// Check GD library version
if (!function_exists('gd_info')) {
    die('Error: GD library is not installed or enabled');
}

$gdInfo = gd_info();
$gdVersion = preg_replace('/[^\d.]/', '', $gdInfo['GD Version']);
if (version_compare($gdVersion, '2.0.28', '<')) {
    die('Error: jpgraph requires GD library version 2.0.28 or higher');
}

// Your jpgraph code here