下面的代码不从IIS 6/PHP 5.2.9显示图像。它从XAMPP工作正常(PHP 5.3)PHP,IIS图像不显示在浏览器
$img = @imagecreate(200, 200);
$background_color = imagecolorallocate($img, 0, 0, 0);
$text_color = imagecolorallocate($img, 233, 14, 91);
imagestring($img, 12, 60, 90, 'image here', $text_color);
header('Last-Modified: ' . date('D, d M Y H:i:s'));
header('Content-type: image/jpg');
header('Content-Disposition: inline; filename=blank_jpeg.jpg');
ob_start();
imagejpeg($img);
imagedestroy($img);
$jpeg = ob_get_contents();
ob_end_clean();
header ('Content-length: ' . strlen($jpeg));
echo $jpeg;
exit;
在IE7,它实际上输出包含 jibberish“CREATOR:GD-JPEG V1.0(使用IJG JPEG V62),”所以我觉得GD正在 – KalenGi 2010-01-23 07:00:30
打开错误日志揭示了大量的非GD错误这一定会造成奇怪的行为。 – KalenGi 2010-01-25 01:11:40