If you run a website on nginx drop error yii core, what could be the problem?

FastCGI sent in stderr: "PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/yii/crmtest/vendor/yiisoft/yii2/helpers/BaseArrayHelper.php on line 123
PHP message: PHP Fatal error: Uncaught exception 'yii\base\InvalidConfigException' with message 'The "id" configuration for the Application is required.' in /var/www/yii/crmtest/vendor/yiisoft/yii2/base/Application.php:219
Stack trace:
#0 /var/www/yii/crmtest/vendor/yiisoft/yii2/base/Application.php(201): yii\base\Application->preInit(Array)
#1 /var/www/yii/crmtest/frontend/web/index.php(17): yii\base\Application->__construct(Array)
#2 {main}
thrown in /var/www/yii/crmtest/vendor/yiisoft/yii2/base/Application.php on line 219" while reading response header from upstream, client: 127.0.0.1, server: mysite.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php5.6-fpm.sock:", host: "127.0.0.1"
June 3rd 19 at 18:57
2 answers
June 3rd 19 at 18:59
Not configured.
Even a cursory review of the log of the fall says that the id is required. - Darron.Trembl commented on June 3rd 19 at 19:02
,
frontend/config/main.php

<?
use \kartik\datecontrol\Module;
$params = array_merge(
 require(__DIR__ . '/../../common/config/params.php'),
 require(__DIR__ . '/../../common/config/params-local.php'),
 require(__DIR__ . '/params.php'),
 require(__DIR__ . '/params-local.php')
);

return [
 'id' =--> 'app-frontend',
 'basePath' => dirname(__DIR__),
 'bootstrap' => ['log'],
 'controllerNamespace' => 'frontend\controllers',
 'modules' => [
 'gridview' => ['class' => '\kartik\grid\Module'],
 'datecontrol' => [
 'class' => '\kartik\datecontrol\Module',
 'displaySettings' => [
 Module::FORMAT_DATE => 'dd-MM-yyyy',
 Module::FORMAT_TIME => 'hh:mm:ss a',
 Module::FORMAT_DATETIME => 'dd-MM-yyyy hh:mm:ss a',
],
 'saveSettings' => [
 Module::FORMAT_DATE => 'php:U', // saves as unix timestamp
 Module::FORMAT_TIME => 'php:H:i:s',
 Module::FORMAT_DATETIME => 'php:Y-m-d H:i:s',
],
],

],
'components' => [
 'request' => [
 'csrfParam' => '_csrf-frontend',
],
 'user' => [
 'identityClass' => 'common\models\User',
 'enableAutoLogin' => true,
 'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
],
 'session' => [
 // this is the name of the session cookie used for login on the frontend
 'name' => 'advanced-frontend',
],
 'log' => [
 'traceLevel' => YII_DEBUG ? 3 : 0,
 'targets' => [
[
 'class' => 'yii\log\FileTarget',
 'levels' => ['error', 'warning'],
],
],
],
 'bot' => [
 'class' => 'frontend\components\TelegramComponent',
 'apiToken' => '411890271:AAGOEkFv8aZSMnNNMK2qmKG5X94Cr4Jtxs8',
],
 'errorHandler' => [
 'errorAction' => 'site/error',
],
 'urlManager' => [
 'enablePrettyUrl' => true,
 'showScriptName' => false,
 'rules' => [
 'admin' => 'zakaz/admin',
 'view/<id:\d+>' => 'zakaz/view',
 'disain' => 'zakaz/disain',
 'master' => 'zakaz/master',
 'shop' => 'zakaz/shop',
 'courier' => 'courier/index',
 'todoist' => 'todoist/index',
 'helpdesk' => 'helpdesk/index',
 'custom' => 'custom/index',
 'versia' => 'zakaz/index',
 'create' => 'zakaz/create',
 'update/<id:\d+>' => 'zakaz/update',
 'login' => 'site/login',
 'logout' => 'site/logout',
 'createzakaz/<id_zakaz:\d+>' => 'todoist/createzakaz',
 'view-todoist/<id:\d+>' => 'todoist/view',

],
],
],
'params' => $params,
];</id:\d+></id_zakaz:\d+></id:\d+></id:\d+>


Config nginx etc/nginx/site-available
server {
charset utf-8;
client_max_body_size 128M;

listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## listen for ipv6

server_name mysite.test;
#root /var/www/yii/crm_2.3/backend/web;
root /var/www/yii/crm_2.3/frontend/web;
#root /var/www/yii/crm/backend/web;
index index.php;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

location / {
# Redirect all requests to non-existent directories and files on index.php
try_files $uri $uri/ /index.php?$args;
}

# uncomment to avoid processing Yii references to non-existing static files
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
access_log off;
log_not_found off;
expires off;
}
#error_page 404 /404.html;

location ~ \.php$ {
include fastcgi_params;
#location 127.0.0.1:9000;
#location unix:/var/run/php5-fpm.sock;
location unix:/run/php/php5.6-fpm.sock;
fastcgi_read_timeout 3000;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers directives 16 16k;
set by the fastcgi_buffer_size 32k;
}

location ~ /\.(ht|svn|git) {
access_log off;
log_not_found off;
deny all;
}
}
- Lia13 commented on June 3rd 19 at 19:05
June 3rd 19 at 19:01
In the end, I put apache2 configured , the site has started, at some point, the same error came out ,that instead of the site displayed only the text in the etc/php/php5.6/apache2 in the confit I put the php file.ini to increase file upload database to phpmyadmin. I thought maybe the php file.ini I put in the config ,removed it and the site started to work normally. ( the main php file.ini which is in the folder cli when you change the amount of data to download the files in phpmyadmin did not respond) where I was still picked in the end when I turned off Apache , the site was already working on nginx ....

Find more questions by tags YiiNginx