Community Documentation

v3 Knowledgebase

How do I increase upload file limit from 2MB under Apache 2 web server

The default setting to upload files is 2MB.

The following settings has to be changed in order to upload files bigger than 2MB:

max_execution_time - This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30.

upload_max_filesize - The maximum size of an uploaded file.

memory_limit -This sets the maximum amount of memory in bytes that a script is allowed to allocate. This helps prevent poorly written scripts for eating up all available memory on a server. Note that to have no memory limit, set this directive to -1.

post_max_size -Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize

upload_max_filesize. -If memory limit is enabled by your configure script

There are two methods to change this setting:

Method # 1: Edit php.ini

When you are using a Server API: CGI/Fast CGI. Create a php.ini file in the website and change the following setting:

Sample outputs (video of 10MB):

memory_limit = 32M
upload_max_filesize = 10M
post_max_size = 20M

Method #2: Edit .htaccess

Add the following setting to the .htaccess file in your root directory. This is useful when you are using a Apache handler instead the CGI/fast CGI.

(Also, you can also create a .htaccess file locally and then upload it using ftp / sftp / scp client)

Setting as follows:
php_value upload_max_filesize 10M
php_value post_max_size 20M
php_value memory_limit 32M

Information taken from