I’m transferring files using http post request from one host to another.
Receiving host runs apache with php onboard.
The request contains multipart/form-data and is performing by php script (cURL).
There are 86 files with total size about 20Mb.
The issue is the receiving php script gots empty $_POST array.
I reconfigured sending script so it sends the same request in loop but removes one file from data collection on each iteration. When 36 files (total size ~12Mb) are removed the receiving script accepts the data, $_POST variable is populated well.
What can be wrong?
I’ve reviewed all resposible php.ini parameters, so they contain reasonable values.
ini_set("post_max_size","510M");
ini_set("memory_limit","400M");
ini_set("upload_max_filesize","510M");
ini_set("max_file_uploads","500");
Is there a way to investigate the reason? I mean, error_log doesn’t contain anything useful. Maybe there is another source to see?
The
post_max_sizevalue cannot be set at runtime on a per-directory basis. Even though yourphpinfo()will reflect the change, it will be ignored when a form is processed and will therefore revert back to the default of 8MB.This is proved by the fact that the total size of your files is 20MB, yet when you remove ~12MB of files, the script works.
The only solution for this is to set the value in the
php.ini, or alternatively as you are using Apache, you can set the value in anhttp.confor.htaccessfile.I too had this issue a while ago, although it was on Windows running IIS. However, the issue is still the same. For more information on the issue please see this thread.