簡體   English   中英

getimagesize適用於某些圖像,而不適用於其他圖像

[英]getimagesize works for some images and not others

我有以下腳本,該腳本在使用PHP 5.2.6的本地服務器上返回圖像的高度和寬度,但在使用5.2.17的共享主機帳戶上不返回該圖像的高度和寬度。

ini_set('memory_limit', '32M');
list($width, $height, $type, $attr) = getimagesize("http://images.jcrew.com/erez4/erez?src=images/eiec/39/39251/39251_WO7826.tif&tmp=prdAr3");
echo "<img src=\"http://images.jcrew.com/erez4/erez?src=images/eiec/39/39251/39251_WO7826.tif&tmp=prdAr3\" $attr alt=\"getimagesize() example\" />";

我嘗試按照另一個問題的建議增加memory_limit 從其他站點獲取圖像大小在本地和遠程都可以,但是對於此站點,只能在本地使用。 可能會發生什么?

聽起來您的共享主機可能已禁用allow_url_fopen 如果尚未安裝,則應配置錯誤日志記錄 ,並確保未在腳本中禁用錯誤報告 它可能會向您顯示一條錯誤消息,以指示失敗原因。

檢查是否禁用allow-url-fopen

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM