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... ...
随机推荐
- CentOS7 安装98五笔输入法
86版的安装方式,网上找到一堆,折腾了很久才把98版的安装上,记录一下. 从这里下了这个 http://bbs.chinaunix.net/forum.php?mod=viewthread&t ...
- 【转载】va_list 可变参数 简介 va_copy vprintf
[说明]本文转载自 smart 的文章 http://blog.sina.com.cn/s/blog_590be5290100qhxr.html 及百度百科 va_list是一个宏,由va_star ...
- 如何利用多核CPU来加速你的Linux命令
原文出处: rankfocus 译文出处: 外刊IT评论 你是否曾经有过要计算一个非常大的数据(几百GB)的需求?或在里面搜索,或其它操作——一些无法并行的操作.数据专家们,我是在对你们说.你可能 ...
- [Objective-c 基础 - 1.1] OC类
Obj-C中没有包得概念,使用前缀进行区分 自带类用NS开头命名 关键字使用@开头 A. 第一个OC程序 1. 导入Foundation框架的主头文件 #import <Foundation ...
- JS 实现地区,省份,城市,县区4级联动
刚学JS,实战一下,做一个省份信息4级联动. 但是网上查了都是3级的,没有4级,现在做一个的是带地区的4级联动,最简单的办法是修改别人的代码,最开始找到的事类似于下边这个的: 省市县关联菜单 < ...
- iOS 强制横屏
// // AAAAViewController.m // hengp // // Created by 朱信磊 on 15/2/13. // Copyright (c) 2015年 niit. Al ...
- 分析Model2系统心得
分析Model2系统心得 前言:观摩他人的项目,学到一些新的.实践经验呀!!! 1. 怎样使用字符串处理类?从页面获取的Form类或者字段取值时使用. 2.在验证用户身份时,先推断username, ...
- cocos2d 中加入显示文字的三种方式(CCLabelTTF 、CCLabelBMFont 和CCLabelAtlas)
在 cocos2d 中有三个类能够在层或精灵中加入文字: CCLabelTTF CCLabelBMFont CCLabelAtlas CCLabelTTF CCLabelTTF 每次调用 s ...
- FindWindow使用方法
函数功能:该函数获得一个顶层窗体的句柄,该窗体的类名和窗体名与给定的字符串相匹配.这个函数不查找子窗体.在查找时不区分大写和小写. 函数型:HWND FindWindow(LPCTSTR IpClas ...
- js操作json添加元素和数据的方法
function addServerUrlToJson() { var json_tem = [{"name":"a","value":1} ...