• Hi Folks,

    i’m having a big problem with my file permissions. The regular WordPress Uploads are having the right permission, but the thumbnails created from these uploads always have a 600 permission, which results in none of my users being able to see these images.

    I searched the admin-functions.php and found out, that the permission for the original uploads is configured here, but it seems that the thumbnails are made by copying and i just can’t find how to give the thumbnails the right permission.

    Another interesting thing is, that this problem is only a part-time problem. sometimes it is working quite well, and other times – without having changed anything – the problem ist back and marking my thumbnails with 600.

    It would be really great, if someone could help me with this problem, though even my hoster has no idea what to do.

    Yours,

    christian jung

Viewing 7 replies - 1 through 7 (of 7 total)
  • I have the same problem! Please advice! This is killing me!

    This is really annoying me as well, It’s time sensitive as my host will be deleted my account shortly as I’ve just moved to a new server. Main images backup fine, thumbnails “Permission Denied” even inside Plesk!

    This is what you need to do to get permission back, create a file called whatever-you-want.php in the same folder as all the thumbnails and copy this code into it:

    <?php
    // Note that !== did not exist until 4.0.0-RC2
    
    if ($handle = opendir('./')) {
        echo "Directory handle: $handle\n";
        echo "Files:\n";
    
        /* This is the correct way to loop over the directory. */
        while (false !== ($file = readdir($handle))) {
            if(chmod($file, 0755)) echo "\n".$file." - CHMOD to 0755 a success<br/>";
            else echo "\n".$file." - CHMOD to 0755 a failiure<br/>";
        }
    
        closedir($handle);
    }
    ?>

    It’s a bit of a fudge but it works! I just wrote it, change 0755 to whatever permissions you want to set. Good luck!

    Obviously you have to run the code by pointing your browser to https://www.yourdomain.com/wp-content/uploads/whatever-you-want.php just make sure you point to the right place.

    I made the whole thing better and posted it in a zip file on my website, you can get it here: WordPress Eats Thumbnails

    Hello again! Chris recently emailed me with a comment, my script doesn’t scan sub-directories and fix the issue as well. Sorry about this, I could add this in but the next version of wp is bound to fix this highlighted problem and sadly I do not have enough time. Instead, please just drag the script in the sub-directories and run it from there.

    I had the same problem and fixed it like this

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Thumbnails with wrong CHMOD Permission’ is closed to new replies.