Dealing with PHP with safe mode on — can't upload images
Recently my host switched on safe mode for PHP due to an exploit. They say they can’t go back to having safe mode off.
For reference: http://php.net/manual/en/features.safe-mode.php
Unfortunately for WordPress, that means I can no longer use the automatic updates and can no longer upload images. Even with chmod 777, and no matter which way I’ve configured the Settings | Media section as far as upload directories are set, I get the dreaded error message:
“foo.jpg” has failed to upload due to an error
The uploaded file could not be moved to /home/users/[…]/public_html/blog/wp-content/uploads.
If I try to set “Organize my uploads into month- and year-based folders” it does manage to create the 2011 and 04 directories, but I still get:
The uploaded file could not be moved to /home/users/[…]/public_html/blog/wp-content/uploads/2011/04.
I’ve used phpinfo to verify that php runs as www on the host’s server (http://zeigen.com/cgi/phpinfo.php).
I can’t run chown directly myself, but I’ve experimented with having support chown all of the PHP scripts to www:www as well as the uploads directory owned by www:www, but I still get the same error messages.
I suspect that WordPress is using some other process to physically upload the file, perhaps an ftp service?
My ISP is running FreeBSD 6.2-RELEASE-p8 (GENERIC).
Has anyone solved this problem?
- The topic ‘Dealing with PHP with safe mode on — can't upload images’ is closed to new replies.