我有一些代碼,增加了一些標頭的圖像:冠軍background.png.php的返回500內部服務器錯誤的PHP映像?
內容:
<?php
$im = imagecreatefrompng("title-background.png");
header('Cache-Control: public');
header('Content-type: image/png');
header('Expires: 19 Febuary 2012 20:00:00 GMT');
imagepng($im);
imagedestroy($im);
?>
,這就是工作的罰款。但是,當我試圖做同樣的與另一個文件,
button.png.php的內容:與500
<?php
$im1 = imagecreatefrompng("button.png");
header('Cache-Control: public');
header('Content-type: image/png');
header('Expires: 19 Febuary 2012 20:00:00 GMT');
imagepng($im1);
imagedestroy($im1);
?>
服務器返回我有我的日誌的訪問權限。
你檢查了圖像的路徑嗎?你有權訪問該文件嗎? – 0x60 2011-01-28 07:28:19
嘗試添加這些行到文件的開頭,以防止500錯誤,然後看看你是否得到一個PHP錯誤:`??php error_reporting(E_ALL); ini_set('display_errors','on');回聲「aaa」;使用ob_flush(); ?> – 2011-01-28 07:38:41