When uploading large files, you might encounter an error message stating that the file exceeds the upload_max_filesize limit. This error occurs when trying to upload files larger than your server’s maximum allowed file size.
Understanding File Upload Limits
PHP and WordPress have several configuration settings that control file upload sizes. The most important ones are:
upload_max_filesize – Sets the maximum size of an uploaded file
post_max_size – Must be larger than upload_max_filesize
memory_limit – The maximum amount of memory a script can consume
How to Increase File Upload Limits
You can increase these limits by modifying your PHP configuration in several ways:
Modify php.ini File:
If you have access to your server’s php.ini file, locate and update these values:
upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
Using .htaccess:
If you don’t have access to php.ini, add these lines to your .htaccess file:
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 256M
Using wp-config.php:
Alternatively, add this line to your wp-config.php file:
@ini_set( 'upload_max_filesize' , '64M' );
@ini_set( 'post_max_size', '64M' );
@ini_set( 'memory_limit', '256M' );
If you continue experiencing issues after implementing these changes, check with your hosting provider, as they may have additional restrictions in place that need to be adjusted at the server level.
Remember to always keep file upload limits reasonable to prevent server performance issues and ensure smooth operation of your DigiCommerce store.