Forums

[resolved] media upload error after update 3.3 (17 posts)

  1. kimdkn
    Member
    Posted 5 months ago #

    Hello everyone,

    I've recently updated to the 3.3 version and now I get this error messages after wanting to upload an image:

    Warning: copy(/public_html/en/wp-content/uploads/2011/12/logo-biosthetique.png) [function.copy]: failed to open stream: Permission denied in /home/asizors/domains/victoriassizors.com/public_html/en/wp-admin/includes/file.php on line 348

    Warning: Cannot modify header information - headers already sent by (output started at /public_html/en/wp-admin/includes/file.php:348) in /public_html/en/wp-includes/pluggable.php on line 866

    The settings of the images appear in the library but the images are not visible.
    How do I fix this?

    Thanks,
    Kim

  2. kionae
    Member
    Posted 5 months ago #

    It sounds like the permissions on your uploads directory are incorrectly set and the files can't be copied over to it. Check your directory permissions (you can usually do this from your FTP program, and often from the file manager in your host's backend panel as well). They should be set to 755 or 777.

  3. dudman
    Member
    Posted 5 months ago #

    I'm having the same problem, my upload directore is 777. I'm wondering if its not some other problem ? have you found a solution yourself yet ?

    Thanks
    Neil

  4. dudman
    Member
    Posted 5 months ago #

    Don't worry, I've just changed permissions to 777 and it words now

  5. MortonVisuals
    Member
    Posted 5 months ago #

    My uploads directory is set to a different user name (server) than all the other folders (user). Could that be the problem? It doesn't give me the option to change the permissions when I log in as the user.

  6. kionae
    Member
    Posted 5 months ago #

    It *could* be the problem, but usually if a directory is owned by the user apache runs as, php doesn't have any problems writing to that directory (of course it's possible that apache isn't running as the 'server' user, and thus can't access that directory... this might be something you'll have to ask your host).

  7. Seth Alling
    Member
    Posted 3 months ago #

    I had the same problem as MortonVisuals.

    Because I run PHP DSO with APC installed on my server, all of my files are uploaded with the user 'nobody' in the group 'nobody'. I really had two ways around it: I could either set my permissions to 777 (which I wasn't comfortable with) or I could set my permissions to 775 and add the user to the group 'nobody'.

    I went with the second option, but you will need root access to your server to set it up like this. When I launch a WordPress site on my server I just need to remember to make sure the username has been added to the group 'nobody'. Then I change the group on all the WordPress files and directories to 'nobody'. Next I modify the permissions of the wp-content directories recursively to 775.

    This setup gets the media uploader working correctly, while keeping my blog much more secure than with 777 permissions. Finally, by adding my own user the group 'nobody', I still have to ability to edit the files with FTP without any permission issues on that side.

    Now everything works well, and I haven't had any problems since. I'll find out for sure after I use the WordPress autoupdate when the next version is released.

  8. Chambo11
    Member
    Posted 1 month ago #

    Sorry, I have changed my permissions to 777 for upload directory and trying all what the forums I found said, but still I face the same permission problem, what could be the solution...?

    Sorry again...

  9. jaydenl
    Member
    Posted 1 month ago #

    Hi Chambo11

    I had this issue too. I used the free FTP program FileZilla to log in and find that some directories had the user/owner of 99/99 - meaning the root apache user owned them, and you can't change their permissions.

    The uploads folder (and its contents) were some of these folders.

    You need to either use SSH to log in to your server and change the directory ownership by using the chown command - or ask your web host to do this for you.

    If you do it yourself, this page mentions chown:
    http://superuser.com/questions/260925/how-can-i-make-chown-work-recursively

    I used the command with a * in it to change all files and folders in the /public_html folder recursively:

    chown -R youruser:yourgroup *

  10. Chambo11
    Member
    Posted 4 weeks ago #

    can you show me how I can find user/owner in FileZilla...? I think that might be the problem, since I have deactivate all plugins and set a theme to default one but still getting the same permission error...
    I really need to fix this before I run out of time...
    Thanks for help, jaydenl...

  11. Chambo11
    Member
    Posted 4 weeks ago #

    also changing permissions to 777, I'm really disapointed...!!!

  12. Seth Alling
    Member
    Posted 4 weeks ago #

    User owner can be found in FileZilla when viewing the details for the file. In mine, it's the farthest right column, but it only shows numbers. 99 is nobody (which my server requires) and 0 is root. Then I've also got some numbers in the 500s. Each user has their own name and group, so all I have to do is change the group.

    If you have root access, you can easily find owner/group by running the following command logging in through SSH:

    ls -l

    I have root access to my server, so I can change them, but I don't believe it's possible to change permissions without it.

  13. jaydenl
    Member
    Posted 3 weeks ago #

    Seth is right. Once you connect to your server using FTP and FileZilla - you can see the user/owner numbers in the far-right column.

    But - if you don't know what SSH is, or if you don't have root access to your server - I highly recommend contacting your web host's tech support, and ask them to change the permissions of all files to 644, all folders to 755, and change all folders within /wp-content/uploads/ to 777

    Unfortunately I think that's the only way you can solve this without having root level access for SSH.

  14. Chambo11
    Member
    Posted 3 weeks ago #

    Thank you I finally solve the issue, thank you very much...
    Be blessed...

  15. jaydenl
    Member
    Posted 3 weeks ago #

    Glad to hear! :)

  16. Shakes72
    Member
    Posted 1 week ago #

    Hi guys please help me before i pull my hair off.

    I am having the same problem and I have followed all the discussion but my problem srill exist.

    Warning: copy() has been disabled for security reasons in /home/..../public_html/mydomain.com/wp-admin/includes/file.php on line 348

    All my imaged do not show and I cannot upload new images. It gives me the error above everytime I try to upload an image

  17. jdouglas71
    Member
    Posted 6 days ago #

    There *has* to be a better option than setting the directory permissions to 777.

Reply

You must log in to post.

About this Topic