Customize your php upload limit Using Four method
By default, the maximum upload file size for PHP scripts is set to 128 megabytes. However, you may want to change these limits. For example, you can set a lower limit to prevent users from uploading large files to your site.
The following configuration illustrates appropiate settings for this example:
- Set memory_limit to 128M. memory_limit describes the maximum amount of memory a script can allocate. It is recommended to set this to maximum available value. Letter M stands for megabytes.
- Set upload_max_filesize to 64M. upload_max_filesizedescribes a maximum size of an uploaded file. It must be larger than the theme file mentioned in the example.
- Set post_max_size to 64M. post_max_size has a similar functionality to upload_max_filesize. Make it larger than 19 MB (theme file) as well.
Customize your php upload limit
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
In most cases if you are on a shared host, then you will not see a php.ini file in your directory.
If you do not see one, then create a file called php.ini and upload it in the root folder. In that file add the following code:
upload_max_filesize = 64M post_max_size = 64M max_execution_time = 300
This method is reported to work for many users. Remember if 64 doesn’t work, then try 10MB (sometimes that work).
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300Again, it is important that we emphasize that if you are on a shared hosting package, then these techniques may not work. In that case, you would have to contact your web hosting provider to increase the limit for you.