WordPress.org

Ready to get started?Download WordPress

Forums

Image upload gives error after crunching (13 posts)

  1. ingejanse
    Member
    Posted 6 years ago #

    I can't upload images to the server via wordpress since updating to 2.5. After selecting and uploading a file, the image is crunched, and then the following error message is shown (roughly, since I've translated it from Dutch to English):

    the uploaded file could not be moved to /var/www/vhosts/eclectro.nl/httpdocs/wp-content/uploads/2008/04. 119

    Used browsers: Firefox 3.0 beta 5 and IE7.

    The number at the end (119) varies per attempt and per session. It does not seem to represent a situation specific error message, but just a random number.

    Already checked:
    -My entire wp-content folder (sub folders and files included) is chmodded to 777.
    -I'm using the no flash plugin for the uploader. Without that, I get the already infamous error message after crunching
    -I have the IE-fix installed
    -I've re-uploaded the entire installation multiple times
    -I've cleared my browser cache completely
    -I've disabled the security thing of the wp-admin folder via the .htaccess file (as described in the sticky)
    -I've cursed thoroughly on dwarfs and cute animals

    ...but all to no avail. Help would be appreciated!

  2. Rok
    Member
    Posted 6 years ago #

    Check this solution, if it helps you to solve your problem.

  3. ingejanse
    Member
    Posted 6 years ago #

    @ Rok, thanks, but it didn't help.

  4. 4k
    Member
    Posted 6 years ago #

    have you disabled plugins and then tried? Some plugins are interferring with the uploader.

    Are you running Bad Behaviour? Without the fix BB will interfere with image uploads.

  5. ingejanse
    Member
    Posted 6 years ago #

    @ 4k: thank you for your suggestions. Just checked the result of disabling all plugins (did that before, but just to make sure), and it didn't solve the problem (both with and without the no flash uploader plugin activated). I'm furthermore not running bad behaviour.

    Hence, the problem is still there :(

  6. rjoerges
    Member
    Posted 6 years ago #

    I have exactly the same problem as ingejanse and did the same things as she did without any effect. I' am running several wordpress-installations on two different servers. Although both of them are running with the same os: opensuse 10.2 and plesk 8.2.x as server-admin-tool. Maybe thats the problem. At least ingejanses directory structure seems to be the same as mine. Any ideas?

  7. hakre
    Member
    Posted 6 years ago #

    The good and the bad news ;)

    The cause of the error is the PHP function move_uploaded_file. This function is not able to move the file. This means, something on the systems filesystem is preventing the move. Can be as simple as missing permissions or the PHP configuration or stuff like quota is over etc..

    How to find out? If you are familiar with PHP I would suggest that you let PHP say what is not working. That can be done by removing the @ (at-sign) in front of the move_uploaded_file function call in wp-admin/includes/file.php at line 175. Then PHP will display an error that you hopefully see and it will provide more info.

    Another way might be if you have a php errorlog available. Then you can check the directory permissions. Then you can check under which user your webserver is running. Then you can check under which user your php (that is wordpress) is executed.

    I hope this information helps you to get some steps ahead at least.

  8. rjoerges
    Member
    Posted 6 years ago #

    @hakre Many thanks for the hints. I will try them as soon as possible i.e. next week.

  9. rjoerges
    Member
    Posted 6 years ago #

    @hakre Ok, i have checked the php log. The picture upload produced this error:

    PHP Warning: realpath(): Unable to access /srv/www/vhosts/MYDOMAIN.de/httpdocs/wp-admin/wp-content/uploads
    in /srv/www/vhosts/MYDOMAIN.de/httpdocs/wp-includes/functions.php on line 1056, referer: http://www.MYDOMAIN.de/wp-admin/media-upload.php?post_id=-1207556517&type=image&

    However WordPress gives this error:

    Unable to create directory /srv/www/vhosts/MYDOMAIN.de/httpdocs/wp-content/uploads/2008/04. Is its parent directory writable by the server?

    See the difference? PHP expects the upload-folder in wp-admin/wp-content a directory that does not exist. I am little bit confused... How can this be? It's a fresh install without any plug-in.

  10. hakre
    Member
    Posted 6 years ago #

    Ensure that the user who runs your php-process is able to create a directory within the /srv/www/vhosts/MYDOMAIN.de/httpdocs/wp-content/uploads/ directory. this is very important, otherwise wordpress is not able to handle your uploads.

    This is about file and access rights under unix.

    This problem can be quite common, there is documentation available in the codex: Changing File Permissions.

    I'm just wondering why I cannot find a good description in codex as well why the install script isn't checking the permissions properly. Filed a Bugreport.

  11. ingejanse
    Member
    Posted 6 years ago #

    We did another test, and it turns out that the folder can be created (say, for instance, /httpdocs/wp-content/uploads/2008/), but that the file can't be moved to it.

    As rjoerges indicates, there seems to be a problem with the exact location of the folder, since the php scripts thinks that it should be at /httpdocs/wp-admin/wp-content/uploads/2008/.

    Can someone check to what extent the script that is responsible for moving the uploaded file searches for the right folder on the right location?

  12. lgaulier
    Member
    Posted 6 years ago #

    I have the exact same problem than Ingejanse and Rjoerges.

    As far as I can understand it, it joins the functions.php path and the upload path in the wp_upload_dir function (line 1079 into functions.php). But my poor knowledge of PHP doesn't allow me to go further and find a correction.

    Does that give anybody, any idea ?

  13. ingejanse
    Member
    Posted 6 years ago #

    Problem solved! The entire explanation of solving it for my setup can be found in this thread.

Topic Closed

This topic has been closed to new replies.

About this Topic