我已在共享主机上成功创建并上传了高级模板.
I've succesfully created and uploaded advanced template on my shared host.
下一步,我必须运行yii migrate
.
但我不能,因为我没有控制台访问权限.
But I cannot because I've not the console access.
你有什么建议给我?
请注意
permissione denied
yii migrate --interactive=0
我也试过这个:向 frontend/controllers/siteController.php
public function actionMigrateUp()
{
// https://github.com/yiisoft/yii2/issues/1764#issuecomment-42436905
$oldApp = Yii::$app;
new yiiconsoleApplication([
'id' => 'Command runner',
'basePath' => '@app',
'components' => [
'db' => $oldApp->db,
],
]);
Yii::$app->runAction('migrate/up', ['migrationPath' => '@console/migrations/', 'interactive' => false]);
Yii::$app = $oldApp;
}
但是当我访问 /frontend/web/index.php?r=site/migrateUp
时,我得到了一个 404
But when I visit /frontend/web/index.php?r=site/migrateUp
I got a 404
异常 'yiiaseInvalidRouteException' 带有消息 'Unable to解决请求:site/migrateUp' 中C:xampphtdocswwwvendoryiisoftyii2aseController.php:122
exception 'yiiaseInvalidRouteException' with message 'Unable to resolve the request: site/migrateUp' in C:xampphtdocswwwvendoryiisoftyii2aseController.php:122
您创建的操作无法通过
The action that you have created is not accesible with
/frontend/web/index.php?r=site/migrateUp
但与
/frontend/web/index.php?r=site/migrate-up
否则一切都会好的.
这篇关于如何在没有控制台访问权限的主机上处理 yii2 迁移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!