kevinkt
kevinkt

Reputation: 745

Yii 2 -- Localhost showing 500 internal server error, no error trace

I'm using this module for Yii 2 for my user registrations: https://github.com/dektrium/yii2-user

I wanted to set up auto login, so I used the solution here: https://github.com/dektrium/yii2-user/issues/685

// ...
'modules' => [
        'user' => [
            'class' => 'dektrium\user\Module',
            'controllerMap' => [
                'registration' => [
                    'class' => \dektrium\user\controllers\RegistrationController::className(),
                    'on ' . \dektrium\user\controllers\RegistrationController::EVENT_AFTER_REGISTER => function ($e) {
                        $user = \dektrium\user\models\User::findOne(['username'=>$e->form->username, 'email'=>$e->form->email]);

                        if ($user) {
                            Yii::$app->user->switchIdentity($user);
                        }
                        \Yii::$app->response->redirect(\Yii::$app->user->returnUrl);
                    },
                ],
            ],
        ],

Unfortunately this creates a 500 internal server error. With no error trace, I'm not sure how to debug this.

How do I even begin to tackle this problem?

Upvotes: 0

Views: 8951

Answers (1)

Patrick
Patrick

Reputation: 1338

If it's a 500, have a look at your Apache error log.

Upvotes: 3

Related Questions