对getimagesize的权限被拒绝

对getimagesize的权限被拒绝

本文介绍了对getimagesize的权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的functions.php中,我得到了:

$size = getimagesize($avatarpath . "/" . $file);

$avatarpath$avatarpath = dirname(__FILE__)."/img/avatars";

我的结构:

functions.php(与img文件夹位于同一目录中).img/头像

functions.php (in the same directory as img folder).img/avatars

functions.php,img,头像的Chmods已设置为777.

Chmods of functions.php , img, avatars has been set to 777.

我仍然收到以下消息:

Warning: getimagesize(/home/godaddy/private_html/img/avatars/avatar_1.png): failed to open stream: Permission denied in /home/godaddy/private_html/img/avatars/functions.php on line 1337

推荐答案

检查运行php的用户.如果您使用的是Godaddy,则它们使用虚拟服务器,因此即使您已进行chmod操作,您的php用户也可能实际上没有访问权限.找出用户,然后将其扔给该用户,看看是否有帮助.

Check the user that php runs under. If you're with godaddy, they use virtual servers so your php user may not actually have access even if you've chmod'd it. Find out the user, then chown it to that user and see if it helps.

这篇关于对getimagesize的权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 15:17