Unable to upload files larger than 2MB to Media Library in self-hosted WordPress blog!

Problem:
I can’t upload any files that are larger than 2MB to the Media Library of my self-hosted WordPress blog. What’s going on? I have a hosting account with Dreamhost.

Answer:

The upload limits are enforced by the hosting provider’s PHP / webserver configuration and not by WordPress blog.

Solution 1:
The hosting provider’s administrator can change the upload_max_filesize and post_max_size directives in php.ini (the PHP configuration file). Ask them to do this for you.

Solution 2:
Also, you can try to override the system-wide default settings in a .htaccess file.

Example, add this to your .htaccess file in your blog folder to set a upload limit of 10 Mega Byte:
php_value post_max_size 10M
php_value upload_max_filesize 10M

This can result in a “Internal Server Error” (error status 500) on all your blog pages. If you get an error after this change, remove your changes. That means that your webhost doesn’t allow such changes in .htaccess.

Solution 3:
An alternative that works for some users: Add a php.ini file in your blog folder with the following contents (notice the difference, here we have a = and no php_value):
post_max_size = 12M
upload_max_filesize = 12M

This may or may not work.

Solution 4:
(This is the best solution but requires more technical knowlege.)
Create a custom PHP.ini and modify it (increase the post_max_size and upload_max_filesize settings) to suit your needs.

You should try searching for specific instructions from your hosting provider on how to accomplish this.

With Dreamhost, here’s the summary of the steps:
1. Create a cgi-bin folder for your domain.
2. Copy the default php.ini file
3. Create the script wrapper
4. Set permissions
5. Set up the .htaccess file
6. Custom the custom php.ini that you’ve just created.
See detailed steps here.

Final solution:
If all else is failed, all you have to do is to use a FTP client program and upload the files to the server. The file size limit above is only set for any uploading using PHP.

Advertisements
%d bloggers like this: