CyberHosting

Problem with WordPress file permissions

Hello gentlemen, ever since we moved our site to digital ocean we have issues with our site media library. We are using a premade image, running ubuntu on cyberportal with openlitespeed on it.

Our root www folder is /home/sitename/public_html/ and everything inside that is set to be under www-data ownership (we tried different options as well). While the whole dir is owned by www-data our media library can’t be updated and wordpress triggers the error (can’t move file to the folder, etc).

Even worse, site library can access all of the existing media (the ones that we moved manually) and display them properly, but all of the newly updated/crated posts and media won’t show properly. It looks like while posting something the media/file is saved but then it gets removed from a featured image (for example) and its thumbnail is broken. We can access the image through a direct link.

I tried everything I could find, from scripts to fix the permissions, through cyberpanel fix permissions and ssh but everything failed. Does anyone have any clue what this could be? Again, only images uploaded now are broken, not the ones that are there already.

Please advice

Comments

  • Just to add on top of that, I've tried spinning up a brand new instance of droplet with the only cyberpanel on it, installed the WP and facing the exact same issues.
  • edited February 7
    I had a similar problem awhile back using ubos linux.
    My notes from then after a lot of headaches included the following code.
    This was for AWS instance using SSH on Arch server.
    However, if you are savvy with code you may be able to customise it.
    ~~~
    sudo bash
    - chmod 400 YOUR.pem - only once for .pem in use.
    > chmod 777 -R /ubos/http/sites/s7281f7da4d229066f5b7fc66963f3e5f272bb400
    > cd /ubos/http/sites/s7281f7da4d229066f5b7fc66963f3e5f272bb400
    # add the last line in wp-config.php
    > nano wp-config.php
    > define('FS_METHOD','direct');
    ~~~
  • Thanks @neweracloud, I tried that but no luck.
  • edited February 8
    Pity, @evlj , it get's complicated at times and that's for sure.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!