PHP警告getimagesize [英] PHP warning getimagesize

查看:222
本文介绍了PHP警告getimagesize的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将图像上传到服务器时出现这些错误

I am getting these errors when trying to upload an image to the server

警告:getimagesize(../images/image-1Product 320120312100APPLE_IMG_0072.jpg)[function.getimagesize]:无法打开流:/home/content/44/8713044/html/admin/Home中没有此类文件或目录.php在第107行

Warning: getimagesize(../images/image-1Product 320120312100APPLE_IMG_0072.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home/content/44/8713044/html/admin/Home.php on line 107

警告:imagecreatefromjpeg(../images/image-1Product 320120312100APPLE_IMG_0072.jpg)[function.imagecreatefromjpeg]:无法打开流:/home/content/44/8713044/html/admin/Home中没有此类文件或目录.php行122

Warning: imagecreatefromjpeg(../images/image-1Product 320120312100APPLE_IMG_0072.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/content/44/8713044/html/admin/Home.php on line 122

警告:imagecopyresampled():在第128行的/home/content/44/8713044/html/admin/Home.php中提供的参数不是有效的图像资源

Warning: imagecopyresampled(): supplied argument is not a valid Image resource in /home/content/44/8713044/html/admin/Home.php on line 128

我知道为什么由于第一个和第二个错误而出现第三个错误,我不知道为什么我得到了第1个和第2个警告,但文件夹确实存在.

I know why I am getting the third error because of the 1st and 2nd error, I dont why I am getting warnings for 1 and 2, the folder does exist.

第107行-$size = getimagesize($source);

第122行-$image = imagecreatefromjpeg($source);

第128行-imagecopyresampled($new_image,$image,0,0,$x,$y,$thumb_width,$thumb_width,$width,$height);

如果有人有任何提示,将不胜感激.

If anyone has got any tips It would be much appreciated.

我将其更改为完整路径,但出现此错误URL file-access is disabled in the server configuration

I changed it over to the full path, but got this error URL file-access is disabled in the server configuration

推荐答案

  1. 尝试输入完整的网址以路由到图片,其中包括http://
  2. 检查您对文件夹的权限,即:正确777

这篇关于PHP警告getimagesize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆