M
M
Mikhail Smirnov2016-07-21 11:40:10
PHP
Mikhail Smirnov, 2016-07-21 11:40:10

How to fix 502 error on centos 6.5?

Good afternoon! When processing a large excel file, the server gives a 502 error ( I
tried to process this file locally on Windows - everything is fine)
in the nginx log this error:
upstream prematurely closed connection while reading response header from upstream
and what to edit.
Server: VPS centos 6.5 + Bitrix web environment

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey, 2016-07-21
@alsopub

Something tells me that it's not nginx that breaks the connection, but upstream.
You need to increase max_execution_time in php.ini (there may be several configs - for the web and for the command line).

A
andrejtad, 2016-07-21
@andrejtad

With a high degree of probability, what sits behind NGINX falls. So, you should first read the logs, and then either twist the execution time or the amount of memory per process.

A
Alexey Emelyanov, 2016-07-21
@babarun

Add to the script

set_time_limit(0);
ini_set('memory_limit', '1024M'); //зависит от того сколько в вашем распоряжении памяти

Better take out the processing of heavy files in the console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question