如何在git bash中使用yii2子命令?
我尝试使用yii2迁移创建新表:如何在git bash中使用yii2子命令?,bash,yii2,git-bash,Bash,Yii2,Git Bash,我尝试使用yii2迁移创建新表: php yii migrate/create create_new_table 当我使用cmd时,一切都正常,但当我尝试使用git bash时: Error: Unknown command "migrate\create". 另外,“php yii migrate”工作正常。只需插入php.exe完整路径,如下所示: C:\xampp\php\php.exe yii migrate/create\u new\u table 如果不希望编写始终完整的php
php yii migrate/create create_new_table
当我使用cmd时,一切都正常,但当我尝试使用git bash时:
Error: Unknown command "migrate\create".
另外,“php yii migrate”工作正常。只需插入php.exe完整路径,如下所示:
C:\xampp\php\php.exe yii migrate/create\u new\u table
如果不希望编写始终完整的php路径,请在windows环境上设置php.exe路径:
请让我知道你的操作系统是什么(Linux/Windows/MAC)?@Sajjad_Dehghani OS Windows 10只需插入你的php.exe完整路径,如:
C:\xampp\php\php.exe yii migrate/create\u new\u table
!但为什么?我写答案,请不要忘记马克·库雷特的答案。谢谢