I started to learn Yii2, but I immediately ran into such a problem: I generate a controller using gii, an error pops up (it is below). What did you do:

  1. Gave full rights (777) to the following directories:

    • sudo chmod -R 777 web / assets /
    • sudo chmod -R 777 runtime /
    • sudo chmod -R 777 assets /
  2. When the entire button is deleted from the runtime, the browse button works, but as soon as something appears in the folder, even generate does not work.

I do not know where else to dig

PHP Warning - yii \ base \ ErrorException mkdir (): File exists

1. in /home/dilun/Projects/Site/4yii2.loc/www/vendor/yiisoft/yii2-gii/Generator.php 

at line 246 237238239240241242243244245246247248249250251252253254255

  public function saveStickyAttributes() { $stickyAttributes = $this->stickyAttributes(); $stickyAttributes[] = 'template'; $values = []; foreach ($stickyAttributes as $name) { $values[$name] = $this->$name; } $path = $this->getStickyDataFile(); @mkdir(dirname($path), 0755, true); file_put_contents($path, json_encode($values)); } /** * @return string the file path that stores the sticky attribute values. * @internal */ public function getStickyDataFile() { 2. in /home/dilun/Projects/Site/4yii2.loc/www/vendor/yiisoft/yii2-gii/controllers/DefaultController.php 

at line 60 - yii \ gii \ generators \ controller \ Generator :: saveStickyAttributes () 54555657585960616263646566

  $preview = Yii::$app->request->post('preview'); $generate = Yii::$app->request->post('generate'); $answers = Yii::$app->request->post('answers'); if ($preview !== null || $generate !== null) { if ($generator->validate()) { $generator->saveStickyAttributes(); $files = $generator->generate(); if ($generate !== null && !empty($answers)) { $params['hasError'] = !$generator->save($files, (array) $answers, $results); $params['results'] = $results; } else { $params['files'] = $files; 3. in /home/dilun/Projects/Site/4yii2.loc/www/vendor/yiisoft/yii2/base/InlineAction.php 

at line 57 - yii \ gii \ controllers \ DefaultController :: actionView () 4. in /home/dilun/Projects/Site/4yii2.loc/www/vendor/yiisoft/yii2/base/InlineAction.php at line 57 - call_user_func_array : {/ home / dilun / Projects / Site / 4yii2.loc / www / vendor / yiisoft / yii2 / base / InlineAction.php: 57} () 5. in /home/dilun/Projects/Site/4yii2.loc/www /vendor/yiisoft/yii2/base/Controller.php at line 157 - yii \ base \ InlineAction :: runWithParams () 6. in /home/dilun/Projects/Site/4yii2.loc/www/vendor/yiisoft/yii2/ base / Module.php at line 528 - yii \ gii \ controllers \ DefaultController :: runAction () 7. in /home/dilun/Projects/Site/4yii2.loc/www/vendor/yiisoft/yii2/web/Application.php at line 103 - yii \ web \ Application :: runAction () 8. in /home/dilun/Projects/Site/4yii2.loc/www/vendor/yiisoft/yii2/base/Application.php at line 386 - yii \ web \ Application :: handleRequest () 9. in /home/dilun/Projects/Site/4yii2.loc/www/frontend/web/index.php at line 17 - yii \ web \ Application :: run () 11121314151617

  require __DIR__ . '/../../common/config/main.php', require __DIR__ . '/../../common/config/main-local.php', require __DIR__ . '/../config/main.php', require __DIR__ . '/../config/main-local.php' ); (new yii\web\Application($config))->run(); 

$ _GET = ['id' => 'controller',];

_ OST = [[cs cs cs $ $ $ $ $ $ $ $ $ $ $ $ $ > '@ app / views / test', 'baseClass' =>' yii \ web \ Controller ',' template '=>' default ',],' answers' => ['e6187b835bb62a46a2fd6894dbcc98a0' => '1', ' 39d797e08377bfc4acdc6dd30a5b0c27 '=>' 1 ',' 90002a96fc14f3ac4dac05afb07246c3 '=>' 1 ',],' generate '=>' ',];

$ _COOKIE = [ 'advanced-frontend' => '0668533ffc4b74935a0f6631ac4a2760', '_csrf-frontend' => '98ef143798901512d85c1a4effb6b991f689a581c564dbbfe0f47fa79af4b4d2a: 2: {i: 0; s: 14: "_ csrf-frontend"; i: 1; s: 32: "EVfTtmzfBweTFxIMD6bs_czK58_JCYR8";} ',];

$ _SESSION = ['__flash' => [], '__captcha / site / captcha' => 'redira', '__captcha / site / captchacount' => 1,];

Yii Framework

2018-01-31 14:24:35

Apache / 2.4.29 (Unix) OpenSSL / 1.0.2n PHP / 7.2.0 mod_perl / 2.0.8-dev Perl / v5.16.3

Yii Framework / 2.0.13.1

    0