'How to change file loading and transfer capacity in Wordpress
I added the following to my .htaccess file, but still can't upload the file.
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value memory_limit 512M
php_value max_execution_time 600
php_value max_input_time 600
Solution 1:[1]
Add the following code to your config.php file.
@ini_set('upload_max_filesize' , '256M');
@ini_set('post_max_size', '256M');
@ini_set('memory_limit', '512M');
@ini_set('max_execution_time', '600');
@ini_set('max_input_time', '600');
Solution 2:[2]
Try adding set_time_limit to wp-config.php
set_time_limit( 600 );
Solution 3:[3]
I think this is correct answer for your question Refer to following URL:
Solution 4:[4]
Add the following code to your config.php file.
@ini_set('upload_max_filesize' , '256M');
@ini_set('post_max_size', '256M');
@ini_set('max_input_time', '600');
Solution 5:[5]
With a code or text editor, add the following code to your existing or new php.ini file:
upload_max_filesize = 32M
post_max_size = 64M
memory_limit = 128M
Solution 6:[6]
Increase the Max Upload File Size in Nginx
On an Nginx server, you can find the php.ini file at /etc/php/7.4/fpm/php.ini. Depending on which PHP version you’ve installed, the exact path may vary slightly.
upload_max_filesize = 64M
post_max_size = 128M
Solution 7:[7]
Use the WordPress ‘upload_size_limit’ Filter
Below is an example of this filter in action from WordPress contributor Drew Jaynes. It defines the upload size limit for all non-admin roles.
/**
* Filter the upload size limit for non-administrators.
*
* @param string $size Upload size limit (in bytes).
* @return int (maybe) Filtered size limit.
*/
function filter_site_upload_size_limit( $size ) {
// Set the upload size limit to 10 MB for users lacking the 'manage_options' capability.
if ( ! current_user_can( 'manage_options' ) ) {
// 10 MB.
$size = 1024 * 10000;
}
return $size;
}
add_filter( 'upload_size_limit', 'filter_site_upload_size_limit', 20 );
Solution 8:[8]
Create or Modify the .user.ini File
If your hosting provider has locked down the global PHP settings, they may have configured the server to work with
.user.inifiles instead ofphp.inifiles.
upload_max_filesize = 32M
post_max_size = 64M
memory_limit = 128M
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dream180 |
| Solution 2 | admcfajn |
| Solution 3 | Chris Tang |
| Solution 4 | Ruby_rails1121 |
| Solution 5 | Dream180 |
| Solution 6 | |
| Solution 7 | |
| Solution 8 | cursorrux |
