【发布时间】:2012-03-01 23:32:41
【问题描述】:
我在一个网站上工作,该网站正在从已关闭 allow_url_fopen 的 cdn 服务器获取图像,这意味着 allow_url_fopen=off。
问题是在主站点显示图像之前,我们必须检查 cdn 服务器中的图像是否存在。如果图像存在,那么我们将显示它,否则不显示。
file_exists 和 file_get_contents 将不起作用,因为它们需要 allow_url_fopen=on。
还有其他方法吗???
任何帮助将不胜感激。
谢谢
【问题讨论】:
-
like mentioned many times before,替代方法是检查 cURL 是否可用。如果不是,您必须尝试stackoverflow.com/questions/3880628/… 中给出的任何解决方案
-
你有 cURL 访问权限吗?
标签: php remote-access file-exists