Ways to Increase Max File Upload Size and Execution TIme
Here is a list of things that I tried on a couple of my sites to increase the file upload size and the script execution time.
Initial File Upload Size: 2M
Initial Execution Time: 30 sec
The first thing I tried was adding some lines to functions.php.
Note: you must be careful when editing functions.php because any mistakes will cause your site to become unusable and you must use ftp to correct the error.
// Increase max upload file size and execution time @ini_set( 'upload_max_size' , '20M' ); @ini_set( 'post_max_size', '20M'); @ini_set( 'max_execution_time', '300' );
This did not work.
Next, I tried an addition to wp-config.php.
define('WP_MEMORY_LIMIT', '20M');
Did not work.
I found several reports that adding the following to .htaccess would work:
php_value upload_max_filesize 20M php_value post_max_size 20M php_value memory_limit 20M php_value max_execution_time 300
I don’t know if I added the lines incorrectly or not, but it caused internal server errors.
Finally, I created two files, php.ini and php5.ini, with the following lines
and added both files to the wp-admin folder. WORKED!!
upload_max_filesize = 20M ; Maximum size of POST data that PHP will accept. post_max_size = 20M max_execution_time = 300
If none of these things work for you, your hosting service support team might increase the limits for you.
I have been googling all day long and tried everything! This finally- did work! Thank you!