wordpress upload file and php max file size

I m not able to upload files to wordpress beyond 1Mb as the uploader is limiting me.

I have checked the phpinfo() and it showing 1000M but still the wordpress uploader is showing 1Mb as the max upload size.

Read More

Strangely i could not update the max_execution time to 1000 even though i have changed the
some in php.ini

Is there some way the hosting providers are blocking some changes to php.ini file.

The info as shown here:

http://nvoids.com/test.php

http://nvoids.com/blog/wp-admin/test.php

thanks

Related posts

Leave a Reply

4 comments

  1. I guess you use multi-site wordpress.
    In this case, you can set “Max upload file size” in
    Network Admin -> Settings -> Network Settings.
    The php setting is rewritten by the wordpress multi-site manangement function.
    I met the same problem, hope this helps you.

  2. WordPress uses two php.ini values to determine the max upload size: upload_max_filesize and post_max_size. See https://github.com/WordPress/WordPress/blob/master/wp-includes/media.php#L1141-L1146. Here’s the method from WordPress’s source that determines the max upload size:

    function wp_max_upload_size() {
        $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
        $p_bytes = wp_convert_hr_to_bytes( ini_get( 'post_max_size' ) );
        $bytes   = apply_filters( 'upload_size_limit', min( $u_bytes, $p_bytes ), $u_bytes, $p_bytes );
        return $bytes;
    }
    
  3. Please add this code in your function.php file

    add_filter('upload_size_limit','ashutosh_increase_upload');
        function ashutosh_increase_upload($bytes){
        return 2650000000; 
    }
    
  4. You can change the settings the easier way if your host is GoDaddy cPanel:

    • Login to the cPanel Hosting Manager Account
    • Search for ‘Select PHP Version’ option and click into it.
    • In the top right corner click the button ‘Switch to PHP Options’
    • Here modify or change any other settings which you need.

    For example:

    max_file_size
    

    I have added the screenshots here:

    Step 2
    Step 3
    Step 4