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
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
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');
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');
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
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
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
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 );