I am using apache2.4 Zend server 2019 and PHP 7.3.
I have a local server and I am using public IP to access the local server through the router. I have an array of size 100 indexes when I am sending through curl as JSON array I am getting 404 error. If I decrease the array size to 30 indexes then the same URL works fine and I am getting responses correct.
I have the corrected post max size, set time limit but nothing is working.
One more thing is when I am accessing localhost through postman with large data size its works fine but through public IP we are getting issue
- Code: Select all
$array = array();
for($i=0;$i<100;$i++){
$innerArray = array(
"ItemNumber"=>"111",
"StorageLocation"=>"SL1",
"Quantity"=>"211.600",
"UOM"=>"KG"
);
$array[$i] = $innerArray;
}
$url = 'http://publicip/projectname/recon.php';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT ,100000);
curl_setopt($ch, CURLOPT_TIMEOUT, 4000000); //timeout in seconds
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($array));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$result = curl_exec($ch);
curl_close($ch);
echo "<br />";
echo $result;
Thanks