Reputation: 515
I'm running a WordPress 2.9.2 Blog with a custom install of Debian in a Amazon Web Services EC2 machine.
Everything was working fine until monday. Then came tuesday, and suddendly, overnight, I can't upload pictures using the default WP file uploader (either flash or html).
When I try to upload a picture, it displays the following error:
File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini or by post_max_size being defined as smaller than upload_max_filesize in php.ini
So I checked out my php.ini, and modified some settings as follows:
But it didn't work. Then I tried chmod -ing the wp-content/uploads/ folder and its subfolders to 777. Didn't work.
Did some research on Google, and added following lines to .htaccess:
<IfModule mod_security.c>
SetEnvIfNoCase Content-Type
"^multipart/form-data;" "MODSEC_NOPOSTBUFFERING=Do not buffer file uploads"
</IfModule>
<IfModule mod_gzip.c>
mod_gzip_on No
</IfModule>
Didn't work. Finally, increased WPs memory limit in wp-settings.php file. Didn't work.
So I'm all out of options by now. Anyone has any ideas on how to solve this? It's really bugging me and my client off!
Thanks in advance!
Upvotes: 5
Views: 26073
Reputation: 1
I had a similar problem. I receive the "empty file" message and proceed to reload the same file that just report the warning. A lot of messages saying " media xxxx already exists" appears and after check, all the posts have been imported with all the attachments. So basically I had to upload each import file twice but on second time it was faster. Hope it helps.
Upvotes: 0
Reputation:
First I created a file called phpinfo.php and put this in it:
<?php
phpinfo();
?>
I accessed the page (I'm using wamp) at localhost/phpinfo.php and checked
upload_max_filesize:
post_max_size:
memory_limit:
I found the location of php.ini and changed these variables upwards to
upload_max_filesize = 100M
post_max_size = 100M
memory_limit = 128M
Then I restarted apache and checked that phpinfo.php reflected the new settings. I was still getting the error, so I changed the directory for the site and all sub directories from read-only to read-write. That seemed to do the trick.
Upvotes: 1
Reputation: 515
Not sure if this was the case (it has been over a year), but in many cases, for this same issue, the problem was due the hard drive being full.
Stupid, I know.
Just check how much space is left, and, if none, go delete logs. Apache, PHP, MySQL. They add up a lot of data when enough time is given.
Upvotes: 3