M
M
My joy2020-02-27 18:53:36
Yii
My joy, 2020-02-27 18:53:36

Broken user->identity when moving code to production server?

Hi all.

Moved the code from the test server to bare production. executed php init, selected production. everything went without errors.

but when you open the site, it swears at the appeal to non-object. it turned out that the
\Yii::$app->useridentity is unattached (var_dump shows NULL). although \Yii::$app->user itself is.

I thought the problem was with namespaces and the User class was not simply tied up. I did the line above:,
User::findOne(1)->first_nameand everything is ok.

Where did \Yii::$app->user-> identity go ?

UPD guys, I e6lan forgot to include short open tag, hence all the jambs. issue resolved.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2020-02-27
@t-alexashka

php init, chose production

Most likely broken configs. This command overwrites config files from environments

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question