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
Cannot increase maximum upload file size in local WordPress
I shouldn't create any php.ini
file in /var/www/html/
. I found /etc/php/7.0/apache2/php.ini
path in phpinfo()
details. So i found and changed these configs in this file : upload_max_filesize
, memory_limit
, post_max_size
and max_execution_time
.
NOTE: I was right!
HTTP error.
while uploading media was because of
bad fix for this problem. now i can upload any media correctly :)
Related Topics
How to Download an Mp3 File from Remote Url
How to Get the Sucess Message in the Same Page After Submitting the Contact Form
Get Selected Option in PHP Without Pressing Submit
Unset a Value in a Multi-Dimensional Array Based on One of the Values
Sum Value in Foreach Loop Every 3 Time Looping
Delete Digits After Two Decimal Points, Without Rounding the Value
Detect a Quotation in a String
How to Get the MAC and the Ip Address of a Connected Client in PHP
Executing Python Script in PHP and Exchanging Data Between the Two
Php Curl Required Only to Send and Not Wait for Response
How to Remove Back Slashes from Json Output in PHP
A Way to Determine Browser Width in PHP Without JavaScript
How to Get Last Insert Id in Sqlite
How Remove the Backslash ("\") in the Json Response Using PHP
Laravel 5.5 Http Error 500 Unable to Handle This Request