Daniel Ho

A Toronto-based management consultant who spends too much time thinking about coffee, riding around on two wheels, photography, books, and fried chicken!

Possible resolution to Wordpress upload errors related to PHP Safe Mode

You may be getting an error message from your Wordpress install that say either "The uploaded file could not be moved..." or "Unable to create directory..."

The obvious step would be to check to see if you have permission to write to that directory.? However, if you tried everything and? you still can't upload to Wordress, this may be the problem...

You may have PHP safe mode turned on.? From the PHP documentation:

"The PHP safe mode is an attempt to solve the shared-server security problem. It is architecturally incorrect to try to solve this problem at the PHP level, but since the alternatives at the web server and OS levels aren't very realistic, many people, especially ISP's, use safe mode for now. "

PHP safe mode won't let you create files or directories if your PHP scripts and upload directory belongs to a different user. So there are 2 possible solutions: either disable PHP safemode (not recommended), or change the owner of scripts and upload directory by issuing the following command after you navigate to the root of the blog.

chown -R apache:apache