
Lot of times it happen that we get some weird error in PHP. One of such errors is a Fatal Error that usually occurs when Uploading big files in PHP.
This error has to do something with the Maximum timeout setting. When we upload a large file it may happen that the timeout occurs and result in failure. This is commonly seen while upgrading plugins in WordPress.
So how to avoid these errors? Well, htaccess comes to rescue in such problems.
Related: 21 Very Useful htaccess Tips & Tricks
The default value of file upload size for most of the webservers is 2MB. This limit a user from uploading large files to the server. Add following lines in your .htaccess file to change the default size for upload. If .htaccess file is not present in your root directory, create one.
php_value max_input_time 200
php_value post_max_size 20M
php_value max_execution_time 200
php_value upload_max_filesize 15M
Code language: Bash (bash)
Nice post, I wasn’t aware of htaccess method. There are other methods to change php time limit: http://www.sudo-juice.com/php-time-limit-extend-script-running-time/