如何检查远程服务器映像是否存在?

时间:2013-05-06 23:36:30

标签: php remote-access

我正在尝试在处理代码之前测试远程图像是否存在..

我找到了这篇文章

How can one check to see if a remote file exists using PHP?

我尝试了getimagesize函数和file_get_contents函数,但我得到了

Warning: getimagesize() [function.getimagesize]: http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /project/testImages.php on line 147

在我的情况下,我无法修改服务器配置。

我不确定如何解决错误或是否有其他方法可以解决。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

为什么在CURLOPT_HEADER设为1(或true)时尝试cURL?然后只检查返回的内容以获取服务器响应。这就是我的方式。

相关问题