yii2 ./yii command : No such file or directory
git clone下来的yii2后台项目,由于需要执行 ./yii migrate命令。执行之后,提示

No such file or directory
我从同样为yii2 basic的./yii 文件的代码复制过来,运行之后还是抱一样的错误,我目前的解决方式是:
把./yii 文件中的代码复制到一个名为yii.php的文件中
<?php
/**
* Yii console bootstrap file.
*
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/ defined('YII_DEBUG') or define('YII_DEBUG', true); require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php'); $config = require(__DIR__ . '/config/console.php'); $application = new yii\console\Application($config);
$exitCode = $application->run();
exit($exitCode);
然后再执行 php yii.php,尝试之后,虽然麻烦了一些,但达到了和./yii 一样的效果,附上一张运行效果,如:

yii2 ./yii command : No such file or directory的更多相关文章
- yii项目连接多个数据库时, MySQL报错No such file or directory
服务器错误 yii\db\Exception SQLSTATE[HY000] [2002] No such file or directory ###'xxx是项目根目录' #0 xxx/vendor ...
- chroot: failed to run command `/bin/bash': No such file or directory
1 使用chroot命令时报错如下: testupgrade:/ # chroot /sb chroot: cannot change root directory to /sb: No such f ...
- mysql-xtrabackup备份sh: xtrabackup_56: command not found与error while loading shared libraries: libssl.so.6: cannot open shared object file: No such file or directory
sh: xtrabackup_56: command not foundinnobackupex: fatal error: no 'mysqld' group in MySQL options解决办 ...
- ansible执行shell模块和command模块报错| FAILED | rc=127 >> /bin/sh: lsof: command not found和| rc=2 >> [Errno 2] No such file or directory
命令: ansible -i hosts_20 st -m shell -a 'service zabbix_agentd star' -K --become ansible -i hosts_2 ...
- jenkins 执行shell命令出错command not found 和No such file or directory
[root@localhost usr]# sh test.sh command not found -bash: cd: usr: No such file or directory 这里碰到了一个 ...
- pip install mysql-python报错1. Unable to find vcvarsall.bat 2 fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory 3.error: command 'mt.exe' failed with exit statu
最近在安装mysql -python 时报错折腾了半天,通过以下方法解决: 1. pip install mysql-python报错 Unable to find vcvarsall.bat (参考 ...
- (转)win7 64 安装mysql-python:_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory
原文地址:http://www.cnblogs.com/fnng/p/4115607.html 作者:虫师 今天想在在win7 64位环境下使用python 操作mysql 在安装MySQL-pyth ...
- 错误解决:error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory
执行以下代码,生成唯一的UID $fp = popen("/xxx/bin/tools/uuidgen system", "r");// $uid = frea ...
- 今天又学了一招,牛逼!!!解决"-bash:No such file or directory"问题
今天在64服务器上:发现好像bash 坏了,用户名前边 用-bash 显示,,前几天就发现这个问题,,,但是当时忙没有解决,,,,,今天来看看到底是怎么回事! File Exists but... ...
随机推荐
- ThoughtWorks(中国)程序员读书雷达 —— 书籍下载整理
ThoughtWorks(中国)程序员读书雷达 http://agiledon.github.io/blog/2013/04/17/thoughtworks-developer-reading-rad ...
- 【UR #12】实验室外的攻防战(BIT)
[题目链接] http://uoj.ac/problem/180 [题意] 给定两个1..n的排列AB,只有当ai<ai+1才能交换ai和ai+1,问是否能够将A转换为B. [思路] 令a[i] ...
- 中断——中断描述符表的定义和初始化(一) (基于3.16-rc4)
1.中断描述符表的定义(arch/x86/kernel/traps.c) gate_desc debug_idt_table[NR_VECTORS] __page_aligned_bss; 定义的描述 ...
- Spring MVC返回JSON数据
将一个对象以json数据格式返回前台: @ResponseBody public User login(User user) { return user; } 在控制器上使用@ResponseBod ...
- 教程-经典Delphi教程网
有理想+志同道合的人+取长补短去协同工作=完美团队一流的项目 + 三流的执行者 = 垃圾项目三流的项目 + 一流的执行者 = 完美项目 自己公司网址:http://www.kaideruixin.ic ...
- [Objective-c 基础 - 2.10] description方法
A. 实例对象打印-description 1.当使用NSLog函数并且使用%@占位符的时候,会调用对象的-description方法 2.拿到-description的返回值,显示到console中 ...
- [一位菜鸟的COCOS-2D编程之路]精灵表单的制作以及简易动画的生成
1.第一步:使用Zwoptex 制作精灵表单 2.制作的表单的名称为 cocos2Dpng,cocos2D.plist: 3.精灵的动画效果 主要分为五部分. // on "init&quo ...
- 重金悬赏的微软:提交Win8漏洞以及发布Win8应用
随着Windows 8.1这个饱受诟病的操作系统的推出,微软想一举改变颓势,也只有从用户体验上下手了. 近来,微软针对Windows 8.1的漏洞,推出了三项奖励措施: 1.对于发现关键性漏洞,并且这 ...
- JavaScript要点(十三) HTML DOM EventListener
addEventListener() 方法 <body> <p>该实例使用 addEventListener() 方法在按钮中添加点击事件. </p> <bu ...
- mac下8080端口到80端口的转发
MAC OS 本质上还是 Unix 系统, Unix 系统大多默认情况下非root用户是无法使用小于1024的常用端口的.这时候如果你开发中需要在普通用户下用到80端口, 比如 tomcat, 比如 ...