• Hello, I’ve had a problem uploading images or media on wordpress. Every time I try to upload an image i get “The uploaded file could not be moved to”

    So i tried everything, i tried CHMOD the upload folder to 777 and many other combinations. But i’ve read that if I “CHOWN the blogs.dir folder to nobody” it may be the solution. But the problem is I dont know how to “CHOWN the blogs.dir folder to nobody”. I have no idea what CHOWN is. Do I need a program an FTP program to do this?

    Can someone just write out simple steps to get this done?
    Thanks a lot.

Viewing 8 replies - 1 through 8 (of 8 total)
  • chown: change the ownership of a file

    more here

    if youre paying for hosting with a company, that’s not really something you have control over.

    is this a server you have some control over? root access?

    if not, there’s not alot more can be said on the chown command.

    For me, I own a VPS with several blogs. I was having issues with adding and removing plugins. I kept getting prompted for FTP credentials – which wasn’t always reliable in my case – and a hassle.

    I searched around and found that using the “chown” command to set the user and group ID’s to the web server, it might resolve the problem.

    Here’s what I did (your mileage may vary):

    1. Using putty I logged in as root to my VPS using SSH.
    2. I changed directory to /home/accountname
    3. Executed: chmod -R nobody:nobody public_html
    Now I can add and remove plugins without being prompted for FTP credentials.

    Note: My operating system is centOS and web server is Apache. Depending on your configuration, you may need to use something else besides “nobody:nobody” for the user:group.

    As a followup to this, I discovered that after changing the ownership to “nobody:nobody” I could no longer access the files using my FTP client!

    I’ve since changed the ownership to “user:nobody” (“user” is my userid) which allows me to access the files with FTP but puts me back to the original problem of not being able to auto-update plugins! GRRRRRR!

    Apache user is “nobody”.

    Any one out there know a solution to this?

    To change ownership of files and folder using chown command requires server’s root access. Once, you change the ownership to nobody, you will not be able to modify that files/folders via FTP. Not even delete. Assigning nobody ownership or 777 permission is risky on a shared server.

    This can happen if your host is running PHP file as Apache user instead of actual user. The solution of this problem is to enable suPHP on the server. You will have to contact your host to enable suPHP.

    Kailash1,
    Fortunately I control my VPS so I can do pretty much what I want. Unfortunately I know now HOW to do it just yet. I will look into suPHP but meanwhile if you have any suggestions, I’d love to hear them.

    If I got Apache to start with an actual user ID, but have different user IDs for each account I set up on my VPS, will that not give me the same problem?

    Example:
    VPS id is “root”.
    Account #1 is “bob”
    Account #2 is “fred”

    Thanks!

    If you can run PHP scripts as a user then you should not face the problem because all the files uploaded via PHP script will get user:user permissions which will get you full control to manage uploaded files.

    Also, if you enable suPHP, you will have to make sure about files and folders permissions. The maximum file permissions should be 644 and folder permissions should be 755. If you assign more permissions then it will give you Internal Server Error.

    Kailash

    I was able to get my VPS provider to help me out. They rebuild my Apache installation and implemented suPHP. They also took care of the file and folder permissions! All is well now ??

    Thanks for your input.

    @cactuscarl Is that Servint you are hosted with?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘CHOWN the blogs.dir folder to nobody’ is closed to new replies.