Change the maximum upload file size
You need to set the value of upload_max_filesize
and post_max_size
in your php.ini
:
; Maximum allowed size for uploaded files.
upload_max_filesize = 40M
; Must be greater than or equal to upload_max_filesize
post_max_size = 40M
After modifying php.ini
file(s), you need to restart your HTTP server to use the new configuration.
If you can't change your php.ini
, you're out of luck. You cannot change these values at run-time; uploads of file larger than the value specified in php.ini
will have failed by the time execution reaches your call to ini_set
.
See the Description of core php.ini
directives.
wordpress max upload size doesn't change
Alright, here are a few solutions I can think of for a localhost user. With localhost, I assume you have full control so try the below options if any works let me know.
.htaccess
Edit the .htaccess file in your WordPress site’s root folder and add the following code:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
Theme functions
add the following code to the theme’s functions.php file, you can increase the upload size:
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
let me know if any of this works.
PHP Change Max File Size Upload
using .htaccess file in the root directory, you can increase the maximum upload size
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
other way change
php.ini file
upload_max_filesize = 128M
post_max_size =64M
max_execution_time = 300
max_input_time = 300
How to increase the max upload file size in ASP.NET?
This setting goes in your web.config file. It affects the entire application, though... I don't think you can set it per page.
<configuration>
<system.web>
<httpRuntime maxRequestLength="xxx" />
</system.web>
</configuration>
"xxx" is in KB. The default is 4096 (= 4 MB).
Related Topics
PHP - Should I Call Exit() After Calling Location: Header
Download File to Server from Url
How to Add Elements to an Empty Array in PHP
PHP Elvis Operator VS Null Coalescing Operator
PHP Sort a Multidimensional Array by Element Containing Y-M-D H:I:S Date
Pass a PHP Array to a JavaScript Function
Filter Array by Its Keys Using an Array of Allowed Keys
Slowness Found When Base 64 Image Select and Encode from Database
Send Email from Localhost Running Xammp in PHP Using Gmail Mail Server
How to Catch the Fatal Error: Maximum Execution Time of 30 Seconds Exceeded in PHP
MySQL Query to Get Column Names
Able to See a Variable in Print_R()'S Output, But Not Sure How to Access It in Code
PHP: How to Send Http Response Code
Force Ssl/Https Using .Htaccess and Mod_Rewrite
How to Solve PHP Error 'Notice: Array to String Conversion In...'