Permission denied on getimagesize

5.8k Views Asked by At

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

There are 1 best solutions below

0
On BEST ANSWER

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.