问题
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