PHP Classes

How to Increase the PHP file upload limit to handle large files: Use Apache Web Server and PHP to process files with size over 2G

Recommend this page to a friend!
  All requests RSS feed  >  How to Increase the PHP file upload l...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

How to Increase the PHP file upload limit to handle large files

Edit

Picture of Antoni Canals by Antoni Canals - 3 months ago (2025-08-03)

Use Apache Web Server and PHP to process files with size over 2G

This request is clear and relevant.
This request is not clear or is not relevant.

+2

I am using the Apache server with PHP and there is a limit of the size of files that can be uploaded to the server to 2GB.

Is there a solution to avoid this limit?

Ask clarification

1 Recommendation

PHP 5.4 Session Upload Progress Bar: Track the progress of file uploads using sessions

This class can track the progress of file uploads using sessions.

It can check a session variable assigned to keep track of the progress of a file upload.

The class can return the current upload progress value in percentage.

The class can set the session variable to cancel a file upload in progress.

It can also move the file to a given directory after the upload has finished.
This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Manuel Lemos by Manuel Lemos Reputation 27250 - 3 months ago (2025-08-10) Comment

Antoni, first, you need to make sure PHP is configured to handle files of the size limit that your PHP application is expected to handle.

In the php.ini file, you may need to change these options:

  1. Set the upload_max_filesize option to the largest file size that you want your PHP application to process.
  2. Set the post_max_size option to a value higher than you set the upload_max_filesize value.
  3. Set the memory_limit option to a high value or -1 to have any limit:
  4. Then you need to configure Apache to handle requests of large HTTP request bodies using the LimitRequestBody directive:
  5. After you change these options, make sure you restart your Web server that runs PHP, so configuration file values take effect.
  6. The package above can be used to show a progress bar while a large file.


Recommend package
: 
: