[英]PHP images returning 500 internal server error?
我有一些代码向图像添加了一些标题:
title-background.png.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的内容:
<?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);
?>
服务器返回500。我无权访问日志。
我怀疑button.png
不存在,无法读取或与imagecreatefrompng()
不兼容。
哇,对不起,伙计们-堆满了stackoverflow服务器。 早餐吃了1分钟,我就解决了...
title-background.png.php是从同一服务器上的.css fie指向的:-但是,button.png.php是来自其他服务器!
现在,我通过放置完整路径(包括http://的路径)来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.