Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用PHP5+从远程URL正确打开图像;伊玛吉克?_Php_Url_Imagemagick_Imagick - Fatal编程技术网

如何使用PHP5+从远程URL正确打开图像;伊玛吉克?

如何使用PHP5+从远程URL正确打开图像;伊玛吉克?,php,url,imagemagick,imagick,Php,Url,Imagemagick,Imagick,我尝试了以下代码: $image = new Imagick(); $f = fopen('http://www.url.com/image.jpg', 'rb'); $image = readImageFile($f); 但它不起作用。 此外,我认为这不是最好的方法,我希望代码中包含最佳实践(不管听起来有多可笑)。 在同一台服务器上,此代码使用GD库,工作正常 $im = imagecreatefromjpeg('http://www.url.com/image.jpg'); 我是否遗漏

我尝试了以下代码:

$image = new Imagick();
$f = fopen('http://www.url.com/image.jpg', 'rb');
$image = readImageFile($f);
但它不起作用。 此外,我认为这不是最好的方法,我希望代码中包含最佳实践(不管听起来有多可笑)。 在同一台服务器上,此代码使用GD库,工作正常

 $im = imagecreatefromjpeg('http://www.url.com/image.jpg');
我是否遗漏了Imagick手册中的某些内容?

尝试更换:

$image = readImageFile($f)


哦,天哪,真是个打字错误!当然你是对的,但即使写得正确,它仍然不起作用。你收到错误消息了吗?
$image->readImageFile($f);