Back to Top

How to Increase the PHP Max Upload File Size

PHP is a simple and powerful language with core features such powerful solution.upload file size limit is for limiting the client to upload the file size. Usually, the php.ini is used to set the maximum upload file size.

Sometimes, you need to upload a large file to your sites like audio or epub file and the default 8mb limit in the server isn’t enough to upload large files.So you can change your server limit from the php.ini file or directly by the .htaccess file.yes, .htaccess allowed you to increase my max upload file size limit.Using PHP file upload, you can control settings like file upload size, file transfer size etc.

You can increase file upload size from php.ini or from the .htaccess file by adding just three line of code.

  1. Upload_max_filesize – The maximum file size for uploading a file
  2. Memory_limit – This sets the maximum amount of memory in bytes.
  3. Post_max_size – Sets maximum size of the post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. If memory limit is enabled by your configure script, memory_limit also affects file uploading.

NOTE: memory_limit should be larger than post_max_size.

Method 1: php.ini File

If you have an access of php.ini file then you need to add/replace the following line of code into the php.ini file.

Save and close the file. Restart apache.You can change 32m to whatever max file size you want.

Method 2: .HTACCESS File

Next, if you don’t have an access of php.ini then you can modify file upload size from the .htaccess file by just adding the following line of code into .htaccess file.

You can use any of the above method to Increase the PHP Max Upload File Size.After modifying the above parameters in PHP.ini, restart your server and upload large files.

Must Read:

GoTo statement in PHP
Table layout using DIV tags
Facebook PageTab Popup

I hope you have enjoyed this tutorial. Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Comments (1)

  1. That’s a sulbte way of thinking about it.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

How does CI/CD works on AWS?

Posted on 7 years ago

Bhumi

How to Fetch Twitter data using cURL

Posted on 12 years ago

Bhumi