Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increasing the maximum post size

Tags:

php

apache

There is a lot of data being submitted no file uploads and the $_SERVER['CONTENT_LENGTH'] is being exceeded. Can this be increased?

like image 371
Daniel Avatar asked May 26 '11 07:05

Daniel


People also ask

What is post max size?

post_max_size is the maximum size for all POST body data. It doesn't matter if you're POSTing JSON or your DVD collection, this is all POST body data. Your file upload counts towards this limit.

What is post max size in PHP?

The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.


1 Answers

There are 2 different places you can set it:

php.ini

post_max_size=20M upload_max_filesize=20M 

.htaccess / httpd.conf / virtualhost include

php_value post_max_size 20M php_value upload_max_filesize 20M 

Which one to use depends on what you have access to.

.htaccess will not require a server restart, but php.ini and the other apache conf files will.

like image 157
John Green Avatar answered Sep 28 '22 06:09

John Green