How to handle yii2 migrations on nodes without access to the console?

I successfully created and uploaded an advanced template on my shared host.

As a next step, I have to run yii migrate.

But I can not, because I do not have access to the console.

What could you offer me?

note that

  • I cannot change the host because this is not my decision.
  • I cannot access the server using SSH
  • I already tried something like PHPShell, but I got permissione deniedwhile trying to runyii migrate --interactive=0

I also tried this: added actionMigrateUp to frontend/controllers/siteController.php

public function actionMigrateUp()
{
    // https://github.com/yiisoft/yii2/issues/1764#issuecomment-42436905
    $oldApp = \Yii::$app;
    new \yii\console\Application([
        'id'            => 'Command runner',
        'basePath'      => '@app',
        'components'    => [
            'db' => $oldApp->db,
        ],
    ]);
    \Yii::$app->runAction('migrate/up', ['migrationPath' => '@console/migrations/', 'interactive' => false]);
    \Yii::$app = $oldApp;
}

But when I visit /frontend/web/index.php?r=site/migrateUp, I got 404

exception 'yii \ base \ InvalidRouteException' with the message 'Unable to resolve request: site / migrateUp' in C: \ XAMPP \ HTDOCS \ WWW \ provider \ yiisoft \ yii2 \ base \ controller.php: 122

+7
2

, ,

/frontend/web/index.php?r=site/migrateUp

/frontend/web/index.php?r=site/migrate-up

.

+3

: Yiic Yii

: yiic migrate --interactive=0 php yii migrate --interactive=0

0

All Articles