I am sure I am missing just a configuration line, but I just cannot figure out which one it is.
My main PHP script is:
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE html>
<html>
<head>
<title>Secure Login: Log In</title>
<link rel="stylesheet" href="styles/main.css" />
<script type="text/JavaScript" src="js/sha512.js"></script>
<script type="text/JavaScript" src="js/forms.js"></script>
</head>
<body>
<form action="tester.php" method="post" name="login_form" accept-charset="utf-8">
Command: <input type="text" name="command" />
<input type="hidden" value="2016-10-14" name="date">
<input type="submit" value="Send Comamnd" />
</form>
</body>
</html>
which basically sends a POST request to another PHP script called tester.php:
<?php
sleep (70); // Sleep 70 seconds, just to go beyond 60 seconds
echo "Done!";
?>
My php.ini has following directives:
max_execution_time = 400
max_input_time = 180
default_socket_timeout = 180
mysql.connect_timeout = 190
session.gc_maxlifetime = 1440
mssql.connect_timeout = 500
mssql.timeout = 600
My http.conf has:
Timeout 216000
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 0
As you see I have set all the related timeout values for both PHP and Apache but still I get this in Firefox after exactly 60 seconds: "The connection to the server was reset while the page was loading."
And if I send the request via OkHttp3 (as a REST service) in Android I get: "D/OkHttp: <-- HTTP FAILED: java.io.IOException: unexpected end of stream on okhttp3.Address" after 60 seconds.
Why can't I increase the timeout? (By the way please don't advise for optimizing my script, I just want to know the solution that lets me run my PHP script more than 60 seconds.)
UPDATE 1:
I tracked the behavior down to this point: the 60 second timeout only appears when I use 3G broadband connection. So strange. I guess there must be a hardware or router or something in that 3G connection that resets the POST request. How can I know what it is and how to prevent it?