In this post I guide how to increase maximum upload file size in WordPress from 2mb to 64mb.
Before my way I tried to:
– Create php.ini to WordPress root and to wp-admin
– Modify .htaccess file
– Modify themes function.php
Nothing of these were working, but then I found a way what really worked. I hope this helps you too.
Finding your php configurations
First you need to know where your php configurations is. Create info.php under your wp-admin.
$ cd wordpress/wp-admin $ nano info.php
In info.php add these lines. This is just normal phpinfo.
<?php phpinfo(); ?>
Goto to site: yourdomain.com/wp-admin/info.php. Example I go to:
Change php configurations
There are couple ways to modify php configurations. One way is to modify php.ini. Other safer way is to add in conf.d folder new ini file that overwrites php.ini configurations. This way you don’t need to touch php.ini.
Go to where your “Scan this dir for additional .ini files” points and create new file upload.ini
$ cd /etc/php5/apache2/conf.d $ sudoedit upload.ini
In this upload.ini add these lines
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
Then restart your apache
$ sudo service apache2 restart
Remember to delete your info.php that you created at beginning of this post.
$ rm wordpress/wp-admin/info.php