Question

How can I increase the upload_max_filesize in WordPress?

Posted November 10, 2013 25.7k views
I changed it here: sudo nano /etc/php5/apache2/php.ini but it didn't work. I am uploading a plugin of a size bigger than 2M. I tried the .htcaccess, but I get a 500 internal error. I have Ubuntu 12.04 Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
12 answers

I follow your link and I fix it! Thanks because It work for me. Here is my way:

  1. using terminal (cmd) and connect to your server via ssh code
  2. type cd \ to go root folder
  3. type sudo nano /etc/php5/apache2/php.ini
  4. add after php.ini file upload_max_filesize = 32M post_max_size = 32M => save your php.ini file
  1. type : sudo service apache2 restart

After the instruction - go to your WP-admin and Bingo :)

sudo service apache2 restart
Did you restart apache2 after editing php.ini?
Thanks. No, I haven't. What was the command again?
Best and easy way is to install the WP HTACESS Plugin if you don't want to mess up with the console :) just increase the value via wordpress and you are done. :)
Thanks for the suggestion, Pablo. Nonetheless didn't work for me just by doing that. I had to look for the file and edit it too.
I did it, and I was able to upload a new theme, but later when i try to upload a picture 500kb , again the
exceeds the maximum upload size for this site! error.
Why?
Any suggestion? if yes, please include shh command.
thanks
@Multilabel: What webserver are you using? Have you tried restarting it after modifying the config files? If you're using nginx, make sure you restart php5-fpm too and modify nginx's upload limit: (#4 of www.if-not-true-then-false.com/2011/nginx-and-php-fpm-configuration-and-optimizing-tips-and-tricks/).
http://wordpress.org/plugins/wp-htaccess-control/
Sorry for the previous short answer as I thought I was signing in. I am fairly efficient with the command line, Apache, PHP and so on. With that in mind I would say the easiest solution (and the one I go with as far as WordPress is concerned) is to install this plugin http://wordpress.org/plugins/wp-htaccess-control/ . Once installed use the plugins tools to set your limit. To do this go to settings --> htaccess Control --> htaccess suggestions --> find the files size field and be sure to only input a numeric value. If this does not work you will need to ssh into into your server and go to sudo nano /etc/php5/apache2/php.ini
and edit the max_upload_filesize set it to something like 20M and be sure to run sudo service apache2 restart.

Hi, all

You can create a php info file in order to check the current values and check which is the php.ini file in use. Create the following file in your public_hmtl folder - phpinfo.php and put the following code inside it:

<?php
phpinfo();
?>

Then check for the current value of upload_max_filesize you can also check which is the configuration file - php.ini that is currently used and apply the changes there (if the site using the global php.ini file and you change the values for these settings this will make the changes globally for all sites). Ideally you would like to have the following values:

upload_max_filesize = 64M

Hope that this helps!
Regards,
Alex

Submit an Answer