Recently I had to upload a very large file to a WordPress site. When I tried to upload anything over 64M I would get an error: Maximum upload file size: 64MB. This is pretty common on unix servers where a max upload threshold is set in php and typically will be solved through adding a few lines of code to a php.ini file. Unfortunately in WordPress it isn’t so straight forward as everyone leads you to believe and the fix is mind boggling simple.
- First if your server doesnt have a php.ini file lets create one.
Create a text file and save it as php.ini. For my example I’m setting my threshold to 500M
Add the code:
post_max_size = 500M
upload_max_filesize = 500M
- Next open your wp-config.php file
Add this line before the authentication keys:
- FTP over wp-config.php into the root of your site
- FTP over php.ini into the root of your site AND the wp-admin folder
That’s it. The key is having the php.ini in wp-admin if your php.ini is not recursive.
Remember some hosts don’t let you overwrite php settings so they may have the settings in Cpanel or like Dreamhost you will have to load a whole version of PHP on top of their version – not a fun exercise.