Why you might have problems uploading graphics

Having installed a fresh WordPress 3.0 blog, I’ve come across three reasons that you may have problems uploading graphics to use in your posts.

One of them may or may not be easy to solve.  It is called “PHP Safe Mode”.  This is part of the PHP software running on the web server and is intended amongst other things to prevent programs from interacting too much with files on the web server.  Unfortunately, by uploading a photo using WordPress rather than FTP you are doing exactly that, because WordPress 3 appears to receive the file first, then create a sub-directory if necessary and finally move the file into it.

A typical error message may ask “Is its parent directory writable by the server?”

If you have your own server or virtual server, then you can usually disable the PHP Safe mode from the control panel (eg. PLESK).  Some hosting companies also offer the option on their packages.

Similarly, if you are running your own Apache server then it is possible that the uploaded directories are owned by the FTP user.  The “uploads” directory needs to be writeable for the web server.  One way to do this is the change the owner (with “chown”), allowing WordPress to write to the directory without having to allow global write access.

The third reason appears to be a possible bug in WordPress 3.0.

If you log into the Dashboard and select “Settings” and then “Media”, there is a field called “Store uploads in this folder”.  By default, this is left blank in new installations.  This can cause the error message “Error saving media attachment”.

If so, try entering “wp-content/uploads” (without the quotes) into the field and saving the settings.

Uploads Folder setting
(click to enlage)

About Graham Tappenden

Graham Tappenden is a blogger from Germany. He has written code for WordPress themes since 2006 and been creating websites since 1994.
This entry was posted in WordPress Basics and tagged , , , , . Bookmark the permalink.