一、问题表现与解决方案
线上一直跑的项目,突然反映说图片访问不了。
然后调试打印错误来看。
Warning: imagecreatefrompng(http://**********************) [function.imagecreatefrompng]: failed to open stream: HTTP request failed! in l1.php on line 31
就感觉很奇怪,明明我本地用浏览器都可以访问呀,而且我通过file_get_contents()也报这个错误。
后来注意到这个访问时间有点长呀 会不会是说超时了。
$context = stream_context_create(array(
'http' =>