Change the maximum upload file size of PHP

Some time we need to upload big size file. But initially PHP allow maximum 2Mb file size to upload. So we need to update PHP maximum file size. To update the maximum size of file upload-
You need to set the value of upload_max_filesize and post_max_size in your php.ini :

Initially this value:

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize=2M

; Maximum number of files that can be uploaded via a single request
max_file_uploads=2M



You can upgrade this value of Maximum file size. E.g:

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize=40M

; Maximum number of files that can be uploaded via a single request
max_file_uploads=40M


Then save the change.

After modifying php.ini file(s), you need to restart your HTTP server to use new configuration.
If you can’t change your php.ini, you’re out of luck. You cannot change these values at run-time; uploads of file larger than the value specified in php.ini will have failed by the time execution reaches your call to ini_set.
Share on Google Plus

About Mahabubur Rahman

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment