WordPress.org

Ready to get started?Download WordPress

Forums

The uploaded file could not be moved to /var/www/vhosts/ (8 posts)

  1. imcarmel
    Member
    Posted 1 year ago #

    I've seen posts on this, but they're about previous versions of WP and have conflicting information... so I'm giving it a try.

    I updated about a month ago to 3.4.1, I used the automatic updater and it broke the site. After several hours we managed to get it up and running again, a friend and I. Today I tried to upload a picture for the first time and got this error message:

    The uploaded file could not be moved to /var/www/vhosts/

    So what do I do? I've seen posts on changing the chmod to 777, and ones saying *never* to do that. Also posts about changing settings in Plesk. And about contacting the hosting service and having them change permissions. I'm not all that versed in this stuff so I'd appreciate any help.

    thanks...

  2. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    What do you have for the setting at:

    Admin Dashboard>Settings>Media>Uploading Files

    There are two text boxes here, are they filled in?

    Search your web hosts help files or call them and ask:

    Do I need to set anything in these text boxes to work on your servers?

    Is there a file size limit in place?

  3. imcarmel
    Member
    Posted 1 year ago #

    Thanks for answering. They're both at the default setting the first one with
    wp-content/uploads
    and the second one is blank.

    I can call the webhost in the morning.

  4. Pioneer Valley Web Design
    Member
    Posted 1 year ago #

    And never set any folder to 777. never, ever.

  5. imcarmel
    Member
    Posted 1 year ago #

    no 'like' button.

  6. imcarmel
    Member
    Posted 1 year ago #

    hello again.
    the web host says the default settings are the correct ones.
    The more I dig around the more I think that the problem is the permissions...both on the uploads and in the plug-in's folders. Perhaps things being in the wrong groups?

  7. gabyp2000
    Member
    Posted 1 year ago #

    The problem is not of permission but of ownership!
    In my case I uploaded the files under user "admin" ... the user is in group Apache so the blog is displaying correctly. Only when trying to upload I get the error mentioned above.
    To solve my problem I just changed the ownership to Apache

    chown -R apache:apache /home/admin/domain.com/*

    The second command will change the owner of all files and folders in folder "domain.com" !
    This solves the problem ... you can upload / delete files via wordpress interface, make updates install delete plugins. BUT ... if you connect to the site via a ftp client using user admin you will not be able delete or override the files as they are not yours anymore, but are of user "Apache" !
    This is no major inconvenience as you administer the WordPress blog mainly from it's interface.
    If you need to gain access again you will have to chown back to you.

    chown -R admin:admin /home/admin/domain.com/*

    (in my case is user admin ... make sure you use your own user).
    This solution is available if you have a VPS and have full root access.
    This problem I did not encountered in CPanel web hosting based servers, but only in certain low cost servers having all kind of control panels probably not well configured !

  8. ashleybmeyer
    Member
    Posted 11 months ago #

    I had this same issue. When trying to upload files (for blog posts) from the wp-admin web view, I was getting the error "The uploaded file could not be moved to public/blog/wp-content/uploads". My stuff is hosted on NFS (nearlyfreespeech.net) and I normally use Cyberduck to upload things and whatnot.

    I'd already changed the permissions of /wp-content/uploads to 777 (read, write, and execute permission for owner, group, and others), but it still wasn't letting me upload!

    The trick that fixed it was changing the name of the /uploads folder to /broken-uploads, and then creating a new /uploads folder.

    Since this isn't possible in Cyberduck (dunno why), I opened Mac Terminal and used SSH to log into my wp-admin. If you've never used terminal or command line, these are the commands to accomplish this:

    ssh username@hostname
    (this logs you into your host)
    cd blog
    cd wp-content
    (this brings you into your wp-content folder, mine is within a folder called blog)
    ls -alh
    (this shows you all the folders contents so you can confirm /uploads already has rwxrwxrwx)
    mv uploads broken-uploads
    (this renames /uploads to /broken-uploads)
    mkdir uploads
    (this creates the new /uploads folder)
    ls -alh
    (make sure you see /uploads in the list, as well as your old /broken-uploads)
    chmod 777 uploads
    (fixes the permissions to let your web wp-admin read write and execute)
    ls -alh
    (double-check that rwxrwxrwx is next to uploads)

    You should be good to go!

Topic Closed

This topic has been closed to new replies.

About this Topic