How Can I Get My Core PHP Upload Limit Raised to 120 mb

Web hosting discussion, programming, and shared and dedicated servers.
6 posts Page 1 of 1
by privadv » Tue Jan 08, 2013 1:47 pm
I need to get the core PHP upload limit raised from 50 mb to 120 mb. It looks like only your tech people can do this. I tried the suggestions of modifying my .htaccess and that didn't change it. Please help me get this fixed

Quincy Follweiler
(360) 751-4443
by thulsa_doom » Wed Jan 09, 2013 10:14 am
You can modify the upload limit by putting in your own custom php.ini file and setting the upload_max_filesize and post_max_size. There has been a recent discussion of how to go about setting your own php.ini file here on the forums.

I hope that helps!
John Fitzgerald
Sonic Technical Support
by rackin » Wed Feb 20, 2013 3:39 pm
We did the following:

You can modify the upload limit by putting in your own custom php.ini file and setting the upload_max_filesize and post_max_size.

The php core local value now says 100M but WP still says 50M. What do I do now?
by thulsa_doom » Wed Feb 20, 2013 5:09 pm
From a quick look around, it seems that in the wp-includes/media.php file there's a wp_max_upload_size function that governs how large Wordpress thinks a media file can be:

Code: Select all

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;
}
So I'm no sure what other than "upload_max_filesize" and "post_max_size" would be involved here. I don't see where else Wordpress gets this setting internally.
John Fitzgerald
Sonic Technical Support
by rackin » Wed Feb 20, 2013 5:55 pm
Thank you, John, but I'm not clear from your email what, if anything, I can do to change the media.php file. Can you please give me specific instructions on how to change the code that you pasted into your response to my query? I'm looking to increase the size to 100M. Thank you!
by rackin » Wed Feb 20, 2013 6:11 pm
Never mind! Found the code I needed at codex.wordpress.org. Thanks for directing me to the media.php file--that was the ticket!

function wp_max_upload_size() {
$u_bytes = wp_convert_hr_to_bytes( '1000MB' );
$p_bytes = wp_convert_hr_to_bytes( '1000MB' );
$bytes = apply_filters( 'upload_size_limit', min($u_bytes, $p_bytes), $u_bytes, $p_bytes );
return $bytes;
}
6 posts Page 1 of 1

Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 12 guests