---
title: "Increasing max file upload size"
date: "2015-10-08"
category: "php"
slug: "increasing-max-file-upload-size"
---

By default, file uploads are restricted to less than 32 MB on a [[viewing-php-settings]] basis. If you need to upload larger files, three PHP settings need to be adjusted.

## Settings to Adjust

These variables can be tuned via an [[htaccess-guide]] or [[changing-php-settings]]. The examples below use `.htaccess` syntax.

### upload\_max\_filesize

Controls the maximum size of a single file upload.

`php_value upload_max_filesize 32m`

### post\_max\_size

The maximum total size of all form data submitted in a single request. Set this approximately 33% higher than `upload_max_filesize`, because uploaded files are transcoded to [base64](https://en.wikipedia.org/wiki/Base64) during transmission, increasing their size by roughly one-third. This value must also accommodate form control variables (typically a few hundred kilobytes).

`php_value post_max_size 42m`

### memory\_limit

Controls the maximum memory a PHP script may use. This is a non-tunable parameter that requires justification to change. Default limits are 96 MB on pre-v6 [[determining-platform-version]] and 192 MB on v6+ platforms.

Depending on how the application handles file uploads, `memory_limit` may or may not affect the process. Applications that load entire files into memory (e.g., using `file_get_contents`) consume more memory than those that stream data in chunks (e.g., using `fread` in a loop).

If you need a higher memory limit, open a support ticket within the [[logging-into-the-control-panel]] for review.

**Note:** Only `upload_max_filesize`, `post_max_size`, and `memory_limit` affect uploads. The `max_execution_time` and `max_input_time` settings do [not affect uploads](http://stackoverflow.com/questions/11387113/php-file-upload-affected-or-not-by-max-input-time).
