我正在尝试从博客文章中解析出一些图片以创建小缩略图。一个特定的图像在Web服务器上失败,但在我的笔记本电脑上没有。
这是一些测试代码:
$vars = getimagesize( 'http://thebestcamera.com/blog/wp-content/uploads/2010/02/img_0084-150x150.png' );
var_dump( $vars );
错误日志确实:
PHP Warning: getimagesize(http://thebestcamera.com/blog/wp-content/uploads/2010/02/img_0084-150x150.png) [<a href='function.getimagesize'>function.getimagesize</a>]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
如果我使用curl,我从服务器获得404,但如果我从笔记本电脑上获取图像,我会得到图像:
curl http://thebestcamera.com/blog/wp-content/uploads/2010/02/img_0084-150x150.png
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /blog/wp-content/uploads/2010/02/img_0084-150x150.png was not found on this server.</p>
<hr>
<address>Apache/2.2.3 (CentOS) Server at thebestcamera.com Port 80</address>
有什么想法吗?