Join the community today
Register Now

Wordpress Installed wordpress manually problem with uploading image

Discussion in 'Blogs & CMS usage' started by Altair, May 26, 2020.

  1. Altair

    Altair Member

    68
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    6:52 AM
    I just uploaded wordpress through ftp and created mysql user db and pass and followed this guide:
    Nginx Wordpress Configuration - CentminMod.com LEMP Nginx web stack for CentOS


    without following the part:
    Advanced Nginx Wordpress Configuration + Fastcgi_cache + Nginx Helper Plugin

    however when I upload image in wordpress admin dashboard I get :
    Uploaded file could not be moved to wp-content/uploads

    what permission should I change for this to work and what's the command? @eva2000

    I saw that these persmission commands solves it, but in the context of centminmod how do I apply them?
    sudo chown -R www-data:www-data /var/www/html
    sudo chmod -R 774 /var/www/html
     
    Last edited: May 26, 2020
  2. Jon Snow

    Jon Snow Active Member

    917
    188
    43
    Jun 30, 2017
    Ratings:
    +293
    Local Time:
    12:52 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Code (Text):
    chown -R nginx:nginx /home/nginx/domains/domain.com/public
    chmod -R 755 /home/nginx/domains/domain.com/public/wp-content/uploads

    Replace domin.com with your domain name.

    Second command assumes Wordpress is domain.com and not installed in an inner directory.
     
  3. Altair

    Altair Member

    68
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    6:52 AM
    this worked thanks!
    but the question is does this pose any security risk?
     
  4. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    1:52 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    How are you loading files ? via root user in sftp or via generated pure-ftpd virtual user ? See getting started guide step 2 if you're using root user via sftp
     
  5. Jon Snow

    Jon Snow Active Member

    917
    188
    43
    Jun 30, 2017
    Ratings:
    +293
    Local Time:
    12:52 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Not if you don't go higher. Some folders higher are owned by root but everything after "public" should be fine.
     
  6. Altair

    Altair Member

    68
    3
    8
    Jan 27, 2018
    Ratings:
    +3
    Local Time:
    6:52 AM
    via root sftp cuz even though I created user and password ftp when creating new site via centmin sh menu, I get connection refused when login through filezilla so I just use root account sftp
     
  7. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    1:52 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    then chown command applies in your case