yii2 installation - migrate command not working(yii2 安装 - 迁移命令不起作用)
问题描述
我正在尝试在 ubuntu 中安装 yii2.
I am trying to install yii2 in ubuntu.
yii2 迁移命令不起作用
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 迁移
或 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 安装 - 迁移命令不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:yii2 安装 - 迁移命令不起作用
基础教程推荐
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
