Increase upload size is not working. Maximum upload file size: 2MB

I cannot upload media larger than 2mb.

I have tried increasing the following:

PHP.ini – <?php

memory_limit = 1024M

upload_max_filesize = 100M

post_max_size = 1024M

.htaccess – <IfModule mod_php5.c>

php_value post_max_size 1024M

php_value upload_max_filesize 1024M

php_value memory_limit 1024M


default-constants.php – define( ‘WP_MAX_MEMORY_LIMIT’, ‘1024M’ );

Network Settings -> Max Upload File Size = 65536

I am still getting an error when trying to upload past 2mb files. What else can I check?

  • Vinod Dalvi
    • WP Unicorn

    Hi @josiahw,

    Thanks for posting on the forums.

    Try logging in and logging out again. Also restarting web server if you can.

    In your WordPress installation folder, locate and edit the file wp-config.php.

    Add the following new lines, taking care not to modify any existing lines which are important to your WordPress configuration:

    /** New memory limit */
    define('WP_MEMORY_LIMIT', '64M');

    Save the wp-config.php file and upload it to your web server, if working on a local copy, overwriting the server copy.

    Add the following code in the functions.php file of your child theme.

    @ini_set( ‘upload_max_size’ , ’1024M’ );
    @ini_set( ‘post_max_size’, ’1024M’);
    @ini_set( ‘max_execution_time’, ’1000? );

    Could you please tell me exactly what error are you getting?

    Kind Regards,

    Vinod Dalvi

  • JosiahW
    • WPMU DEV Initiate

    Adding that code to the wp-config.php file did not resolve the issue.

    Adding that code to the functions.php in the Avada Child Theme made the pages all load blank. Maybe I am doing something wrong. Here is the entire code I put into the functions.php file:

    @ini_set( ‘upload_max_size’ , ’1024M’ );
    @ini_set( ‘post_max_size’, ’1024M’);
    @ini_set( ‘max_execution_time’, ’1000? );

    If I don't put in the <?php I just get that code strong across the top of my page.

    Attached is a screenshot of the error I am getting when trying to upload media through the media manager.

  • Vinod Dalvi
    • WP Unicorn

    Hi Alan,

    Thanks for posting on the forums.

    Ideally its not a good process to post on a thread 13 months old. The plugin has changed since then and so has WordPress :slight_smile:

    It might be best if you open your own here , even if the issues seem closely related. That way it will remain independent of this one and ensure it doesn’t confuse issues here if this thread needs reopening again by the author.

    It also means the member who started this thread or anyone following it isn’t inundated with post notifications each time we respond to each other. A lengthy thread could annoy the original.

    This also allows us to better track and answer your questions to ensure we don’t miss any for ya.

    You can also include reference of this thread in your newly created thread if you want to.

    We would be more than happy to help you on your new thread :slight_smile:


    Vinod Dalvi

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.