Ошибка 504 тайм-аут шлюза

У меня проблема с загрузкой файла Excel с сайта. Я использую kartik\export\ExportMenu; Я добавляю в скрипт в это:

 <?php
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
$gridColumns = [
    'order_number',
    [

Но это не помогает. Как я мог это исправить?

public function actionIndex()
{
    $searchModel = new OrderSearch();
    $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

    return $this->render('index', [
        'searchModel' => $searchModel,
        'dataProvider' => $dataProvider,
    ]);
}

2 ответа

Есть три конфигурации, которые могут помочь в случае тайм-аута, но это не гарантируется.

Варианты для установки в ExportMenu Конфигурация виджета:

  1. Ссылки на большие файлы

    'stream' => false
    
  2. Поток больших файлов

    'stream' => false, // this will automatically save the file to a folder on web server
    'streamAfterSave' => true, // this will stream the file to browser after its saved on the web folder 
    'deleteAfterSave' => true, // this will delete the saved web file after it is streamed to browser,
    'target' => '_blank',
    
  3. Пакетная загрузка

    'batchSize' => 10,
    'target' => '_blank',
    

Попробуйте увеличить max_execution_time

 <?php
    ini_set('max_execution_time', 3600); //3600 seconds = 60 minutes
       $gridColumns = [
       'order_number',
  [
Другие вопросы по тегам