Permission denied on getimagesize

梦想与她 提交于 2019-12-11 03:19:10

问题


In my functions.php I got:

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

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

My structure:

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

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

And I still receive the following message:

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


回答1:


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.



来源:https://stackoverflow.com/questions/7799478/permission-denied-on-getimagesize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!