Monthly Archives: August 2009

WordPress Media upload HTTP Error

WordPress and WordPress-MU have given me the HTTP error in the various installations I have performed and each time there’s a different cause. This post is nothing more than a personal notation for future reference but I hope it’s helpful to someone.

Error: when trying to upload media using the WordPress Flash uploader it get the message HTTP Error

Disclaimer: before messing with your .htaccess file, make sure you have a backup copy of it in case it causes a 500 Server configuration error. If this happens just replace the .htaccess file with the back up version. Check your code for any mistakes and try again.

Possible causes:

  • mod_security – basically all Apache servers will have it turned on, so you may need to turn it off for the async-upload.php file using .htaccess. The newer versions of WP have added this code already, but in case you mess up your htaccess file, here it is.  Just add the following lines to the bottom of your .htaccess file in the root folder of your WP or WP-MU installation. 
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

  • Access Denied Error 403/ Permission issue – another typical problem. Make sure that the upload folder is writeable by the server, you can set the permission to 754 and it should work fine. In WordPress the upload folder sits under /wp-content/  in WP-MU it sits under /blogs.dir/”blog number”/files  (default site blog number is 1 and the other blogs are numbered in ascending order of creation)
  • PHP Upload limit – check you PHP.ini settings for the settings upload_max_filesize and post_max_size. You can change these directly in your PHP.ini if you have access to it or you can change it by adding a php.ini file to you root directory with the following code. The default is normally 2M but you can change it to anything at your own risk, you should not need more then 8M.)
post_max_size = 8M
upload_max_filesize = 8M

or by adding the following lines to your .htaccess file:
php_value upload_max_filesize 8M
php_value post_max_size 8M

for anything above 8M you may need to add an execution time to the .htaccess code also
php_value max_execution_time 800

  • Authentication Failed Error 401- I checked my server log and noticed that WordPress was trying to access the 401.shtml error template every time I got the HTTP error during a media upload attempt. This normally occours if you are using password protection for the WordPress root folder or the folder where your uploads should reside. You should disable the password protection on the folder i norder for the uploader to work.

Hope it helps. Please leave your contributions and bug reports so others can benefit from it.

Technorati Tags: , , , , , ,

Creating a bootable Linux USB flash drive

I am currently working on a project to offer an Open Source Linux based Network Tool pre-installed in a very small custom built computer (like the fit-pc or linutop), I want to avoid having a CD drive and want to keep it simple for the client to reinstall the system if needed.  I decided to create a bootable USB Flash Drive to accompany the system, while looking around I found this great application called UNetbootin that will create a bootable USB Drive from any Linux OS ISO image. You can create the bootable USB drive from either a Linux or Windows desktop.

UNetbootin has presets for most major Linux distros and can be also used to load various other systems:

Technorati Tags: , , , , ,