Support » Fixing WordPress » Image upload gives error after crunching

  • 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/ 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!

Viewing 12 replies - 1 through 12 (of 12 total)
  • Check this solution, if it helps you to solve your problem.

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

    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.

    @ 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 🙁

    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?

    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.

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

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

    PHP Warning: realpath(): Unable to access /srv/www/vhosts/
    in /srv/www/vhosts/ on line 1056, referer:

    However WordPress gives this error:

    Unable to create directory /srv/www/vhosts/ 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.

    Ensure that the user who runs your php-process is able to create a directory within the /srv/www/vhosts/ 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.

    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?

    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 ?

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Image upload gives error after crunching’ is closed to new replies.