• Resolved hambleturtle

    (@hambleturtle)


    I’ve the default Ubuntu20.04 install of wordpress 5.6 – installed by following Digital Ocean’s guide but can’t work out how to increase the upload limit from the default of 2MB.

    The plugin “Wp Maximum Upload File Size” tells me

    Important: if you want to upload files larger than 2MB (which is the limit set by your hosting provider) you have to contact your hosting provider.
    It’s NOT POSSIBLE to increase that hosting defined upload limit from a plugin.

    So how do I change the limit? I’ve root on the host machine, I can start down the rabbit hole of grepping for the string “Maximum upload file size” which seems to be printed with $max_upload_size… but surely I’m missing something obvious.

    Before I installed the plugin (I’m not running any other plugins and didn’t think I needed one for this) I’ve attempted to follow the instructions here to increase the size from 2MB so:

    /var/www/mysite.com/.htaccess has this at the end

    php_value upload_max_filesize 100M
    php_value post_max_size 100M
    php_value memory_limit 256M
    php_value max_execution_time 300
    php_value max_input_time 300

    /var/www/mysite.com/wp-config.php has this at the start

    @ini_set( ‘upload_max_filesize’ , ‘128M’ );
    @ini_set( ‘post_max_size’, ‘128M’);
    @ini_set( ‘memory_limit’, ‘256M’ );
    @ini_set( ‘max_execution_time’, ‘300’ );
    @ini_set( ‘max_input_time’, ‘300’ );

    I’ve found more instructions
    so now both:
    /var/www/mysite.com/wp-includes/functions.php and
    /var/www/mysite.com/wp-content/themes/twentytwentyone/functions.php
    contain
    to include

    @ini_set( ‘upload_max_filesize’ , ‘101M’ );
    @ini_set( ‘post_max_size’, ‘102M’);
    @ini_set( ‘max_execution_time’, ‘300’ );

    yet when I go to upload media I’m still presented with Maximum upload file size: 2 MB. I’ve force reloaded I’ve rebooted the server, I’ll not resorted to live animal sacrifice yet though…

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter hambleturtle

    (@hambleturtle)

    Sigh finally found it I needed to edit /etc/php/7.4/apache2/php.ini to edit these two values

    set post_max_size = 100M
    upload_max_filesize = 100M

    Yes I know it’s not wordpress it’s the underlying LAMP stack but…

    • This reply was modified 4 years, 1 month ago by hambleturtle.

    Saved me some time, thanks!

    Though my WordPress was from bitnami at AWS (marketplace) and placed on an ec2 and the php.ini was located at /opt/bitnami/php/etc. changed those 2 and it worked.

    Hi there, if you want to increase maximum upload size limit in wordpress, you can use Increase Upload Limit Plugin. Using this plugin, you can increase up to 1000GB for LIFETIME Free of Cost. Please give rating. A huge thanks in advance.
    You can download Plugin from here or Go to WordPress Dashboard -> Plugins-> Add New, search Increase Upload Limit or pavankumarsadhu.

    Ubuntu 20.04.3 LTS
    nginx/1.18.0
    php 7.4.3

    There’re two places for php.ini,

    /etc/php/7.4/cli/php.ini
    /etc/php/7.4/fpm/php.ini

    update values at /etc/php/7.4/fpm/php.ini works!

    @rktrowny Thanks man! You save my time. I have tried anything but none of them seem works! There are 2 places php.ini you need to edit!

    /etc/php/7.4/cli/php.ini
    /etc/php/7.4/apache2/php.ini

    basically in this directory
    /etc/php/7.4/

    It works for me!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to increase Maximum upload file size from 2MB’ is closed to new replies.