3

I am sending data to PHP through HTTP POST. This works fine for data shorter than 8MB (8192KB), however when higher quantities of data are sent, PHP shows the $_POST variable to be empty. I emphasize that the $_POST variable does not even contain the names of the post fields, it exists as an empty array. The critical point seems to be between 8.0MB and 9.0MB, and continues higher of course.

I have attempted the following with no success:

ini_set('memory_limit', '500M');
ini_set('post_max_size', '220M');
ini_set('upload_max_filesize', '220M');

I require the data to pass through HTTP POST. The data cannot be uploaded as a file.

Also could Apache be responsible for this?

Any help would be appreciated.

5
  • 3
    8MB = 1024KB? Really? Last time I checked it was 8192KB... 8Mb (mega bits) are 1024KB (kilo bytes) but this is pretty irrelevant in terms of PHP/Apache... Commented Dec 20, 2011 at 10:00
  • Do you have an access to modify these settings via ini_set? Commented Dec 20, 2011 at 10:01
  • @Michael Sazonov I can change the maximum execution time through ini_set like this ini_set('max_execution_time', 300);. So I assume yes. Commented Dec 20, 2011 at 10:04
  • @Michael Sazonov there is no .htaccess. Commented Dec 20, 2011 at 10:12
  • ini_set('post_max_size', '220M'); and ini_set('upload_max_filesize', '220M'); won't work in php script because they are applied after getting file by PHP. You should define them in php.ini or in .htaccess or in vhost config Commented Dec 20, 2011 at 10:15

3 Answers 3

4

This will help

What are the caveats with increasing max_post_size and upload_max_filesize?

And maybe

http://blurringexistence.net/archives/11-PHPs-max_post_size.html

Sign up to request clarification or add additional context in comments.

Comments

2

take a look at the documentation comments. when the script is executed, itäs too late to change sopme setting, wich includes post_max_size, for example. to change these values, try to use a .htaccess-file like this:

php_value upload_max_filesize 200M
php_value post_max_size 200M

or change these settings directly in your php.ini.

Comments

0

post_max_size is, according to the documentation, defined as a PHP_INI_PERDIR setting. It can be set in your php.ini or .htaccess file. A definition for PHP_INI_PERDIR is given here: http://www.php.net/manual/en/configuration.changes.modes.php

Settings that are defined as PHP_INI_ALL can be set with ini_set().

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.