Gateway Time-out:The gateway did not receive a timely response from the upstream server

Harish Singh picture Harish Singh · Dec 9, 2013 · Viewed 39.6k times · Source

I am sending 300 newsletter at a time with a url, after 2 min it refresh itself again to send next 300 at so on.

But I am getting this error:

Gateway Time-out

The gateway did not receive a timely response from the upstream server or application.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I have set max execution to 3600

ini_set('max_execution_time', 3600);

But I am regularly getting same error. Please help me to find out the solution.

Answer

Mario Radomanana picture Mario Radomanana · Mar 4, 2015

I encountered the same problem and I used ini_set('default_socket_timeout', 6000); to fix it. http://php.net/manual/en/filesystem.configuration.php#ini.default-socket-timeout