Chris Smith
Chris Smith

Reputation: 764

PHP Empty $_POST

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.

Upvotes: 3

Views: 766

Answers (3)

RickN
RickN

Reputation: 13500

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().

Upvotes: 0

oezi
oezi

Reputation: 51797

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.

Upvotes: 2

Related Questions