S
S
shanik2018-03-10 19:31:05
Yii
shanik, 2018-03-10 19:31:05

Why does Yii2 return 502 error?

returns 502 when calling this function.

public function actionPravka()
{
$session = new Session;
$session = Yii::$app->session;

$group = Taxon::find()->orderBy(['rang_id' => SORT_ASC])->all();
foreach($group as $k=>$item) {
// открываем сессию
$session->open();
$session->set('value', round(++$k * 100 / count($group), 2, PHP_ROUND_HALF_UP));
if($item->rang_id == 4) {
//$family = Taxon::find()->where(['id' => $item->parent_id])->all();
$klass_id = Taxon::find()->where(['id' => $item->parent_id])->all();
$otdel_id = Taxon::find()->where(['id' => $klass_id[0]['parent_id']])->all();

$customer3 = Taxon::findOne($item->id);
$customer3->klass_id = $klass_id[0]['id'];
$customer3->otdel_id = $otdel_id[0]['id'];
$customer3->update();
}
// закрываем сессию
$session->close();
}
// уничтожаем все данные сессии
$session->destroy();
echo 'Обновлено';
}

the hosting provider wrote this:
Somewhere on your site, this page does not refer to a domain, but to 127.0.0.1
2018/03/10 18:29:27 [error] 7714#0: *228300318 upstream sent too big header while reading response header from upstream, client: 31.153.88.18, server: sait.ru, request: "GET /admin/statistics/pravka HTTP/1.1", upstream: " 127.0.0.1:8070/admin/statistics/pravka ", host: " sait.ru", referrer: " sait.ru works
without sessions.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question