yii2安装-迁移命令不起作用 [英] yii2 installation - migrate command not working
问题描述
我正在尝试在ubuntu中安装yii2.
I am trying to install yii2 in ubuntu.
yii2 migration命令不起作用
yii2 migrate command not working
yii migrate
我遇到了以下错误
php yii /var/www/event-tracking/migrate
PHP Deprecated: Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0
Could not open input file: yii
推荐答案
安装应用程序后,必须执行以下步骤来初始化已安装的应用程序.您只需要一次完成这些操作.
After you install the application, you have to conduct the following steps to initialize the installed application. You only need to do these once for all.
执行init
命令并选择dev作为环境.
Execute the init
command and select dev as environment.
php /path/to/yii-application/init
创建一个新数据库,并相应地调整common/config/main-local.php
中的components.db配置.
Create a new database and adjust the components.db configuration in common/config/main-local.php
accordingly.
通过控制台命令应用迁移:
Apply migrations with console command:
yii migrate
或对于Windows:
or for windows:
php yii migrate
此命令应在用户数据库中创建表User,and Migration
This command should create the table User,and Migration in your database
ref [Yii2文档]
这篇关于yii2安装-迁移命令不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!