How to upload files to WordPress larger than 2MB
Hey there, I’m Vaughn Bullard. Today, I’m gonna talk to you about uploading files larger than 2 megabytes. Now why on earth would I want to upload files larger than 2 megabytes? Well, you may want to upload high bandwidth media such as large zip files, images and videos for use on your WordPress installation. There are plenty of reasons why one would want to do this.
We’re going to edit two files in WordPress and on your server. Don’t worry there’s no coding on this one! It is as simple as editing some text files.
You’re gonna have a default upload size for WordPress of 2 megabytes. So the first file we’re gonna have to edit is called the PHP.INI file. This will be in your server root directory. Why? Because of the way those folks over at Automattic, the publisher of WordPress, designed it.
This is a simple task. We’re gonna modify a few lines of parameters. Now parameters are settings that tell the server “Hey dude, here’s your maximum memory size for running WordPress, now run with it!” Obviously, changing parameters can either increase or decrease your performance. So it’s important to monitor how your WordPress installation runs!
TIP: This is called “Tuning”.
Go into your text editor and if you don’t have one already on your server create a plain text file called php.ini. here, our memory_limit to let’s say 10 megabytes, as well as upload_max_filesize, and post_max_size. We’re also gonna tell our server also to ALLOW file_uploads by telling it ON here.
So what we’re gonna do when we’re done here is to save this file. Now this may be dependent upon whether you’re saving it to a remote server or a local file. A few things here. If you are running WordPress on a hosted platform, you may or may not have access to the php.ini file. If so check with your hosting provider to get these settings modified. However, if you have access to it, it will also be dependent upon the operating system that your WordPress installation is running on! In my example, I’m going to save it to my /etc/httpd/ directory.
TIP: Not sure where your php.ini file goes? Check out PHP.net at http://php.net/manual/en/configuration.file.php
Because these are initialization parameters, you may have to restart your server, depending on your configuration, in order for those parameters to take effect. With this done, you should now be able to upload files larger than 2 megabytes!
Tip: the goal of the php.ini file is to provide initialization parameters to your PHP interpreter that runs WordPress. Parameters like memory size and maximum file upload sizes are commonly modified for tuning your WordPress installation.
Here’s a tip though: If you can optimize file sizes do it! No one wants to sit and download large files. Use your native image and video editors and compress them as much as you can.