If you tried to upload a big file in WordPress and came across this error “exceeds the maximum upload size for this site”, this is for you.
This has nothing to do with WordPress and is a php.ini resource limit set by the server. If you are in a shared hosting environment with no access to editing php.ini, woe on you. There’s nothing you can do. Get a VPS or dedicated server!
On a VPS or dedi, the first step in fixing the issue is determining which php.ini is the cause of this, as there may be many. For this, create a file with the following content:
<?php phpinfo(); ?>
Name it as phpinfo.php and run it on you site. It will show you the resource limits, and the php.ini file which caused this. Once you locate the correct php.ini, edit it and change the values for these variables: upload_max_filesize and post_max_size. Yes both of them need to be increased.
Save the php file and you’ll notice the changes right away. If not restart the apache (or nginx) server with:
service apache2 restart
Note that on Webmin, each Virtualmin virtual server has a seperate php.ini file. You can edit it at Virtualmin>Services>php5 configuration>Resource limits
Joel G Mathew, known in tech circles by the pseudonym Droidzone, is an opensource and programming enthusiast.
His favorite pastime is grappling with GNU compilers, discovering newer Linux secrets, writing scripts, hacking roms, and programs (nothing illegal), reading, blogging. and testing out the latest gadgets.
When away from the tech world, Dr Joel G. Mathew is a practising ENT Surgeon, busy with surgeries and clinical practise.