我運行一個購物網站,並試圖將這個遠程gif圖像的副本保存爲我的服務器作爲jpg。PHP遠程圖像在瀏覽器中打開,但imagecreatefromgif:未能打開流:操作失敗
$i='http://www.medexsupply.com/images/RO1R910C.GIF';
$imagejpg = imagecreatefromgif($i);
,並讓以下錯誤:
Warning: imagecreatefromgif(): Couldn't resolve host name in /home/xxxxx/public_html/xxxxxxx/file.php on line 46
Warning: imagecreatefromgif(http://www.medexsupply.com/images/RO1R910C.GIF): failed to open stream: operation failed in /home/xxxxx/public_html/xxxxxxx/file.php on line 46
上線46,代碼 $imagejpg = imagecreatefromgif($i);
我有專門的服務器有128MB內存限制PHP腳本。
allow_url_fopen處於打開狀態。
我可以修改我的服務器上的任何設置。
我可以複製成千上萬的其他遠程圖像,但不是來自其他一些網站的圖像和圖像。
有人可以幫忙。
如果您想了解更多信息,請回復。
謝謝
嘗試使用已解析的IP地址代替主機名。 '2.20.242.177' = www.medexsupply.com –
如果你把URL放到瀏覽器中,你會得到有效的圖像嗎?如果您嘗試這樣做,某些站點不允許圖像熱鏈接並返回錯誤。 –
這可能不是一個好主意,allow_url_fopen *在 – Pete