2015-04-24 23:29:04 8640次浏览 3条回答 2 悬赏 0 金钱

做法如下:
1、cp -r backend api
2、把api里的backend关键字替换成api

报错如下

exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "site/error".' in /Users/trylife/demo/vendor/yiisoft/yii2/base/Module.php:461
Stack trace:
#0 /Users/trylife/demo/vendor/yiisoft/yii2/web/ErrorHandler.php(80): yii\base\Module->runAction('site/error')
#1 /Users/trylife/demo/vendor/yiisoft/yii2/base/ErrorHandler.php(95): yii\web\ErrorHandler->renderException(Object(yii\web\NotFoundHttpException))
#2 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\NotFoundHttpException))
#3 {main}
Previous exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "".' in /Users/trylife/demo/vendor/yiisoft/yii2/base/Module.php:461
Stack trace:
#0 /Users/trylife/demo/vendor/yiisoft/yii2/web/Application.php(83): yii\base\Module->runAction('', Array)
#1 /Users/trylife/demo/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#2 /Users/trylife/demo/api/web/index.php(18): yii\base\Application->run()
#3 {main}

Next exception 'yii\web\NotFoundHttpException' with message 'Page not found.' in /Users/trylife/demo/vendor/yiisoft/yii2/web/Application.php:95
Stack trace:
#0 /Users/trylife/demo/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#1 /Users/trylife/demo/api/web/index.php(18): yii\base\Application->run()
#2 {main}

经过不懈的百度....
一看便知
/common/config/bootstrap.php ...

您需要登录后才可以回答。登录 | 立即注册
trylife
总监

trylife Beijing

注册时间:2015-03-26
最后登录:2020-12-07
在线时长:51小时55分
  • 粉丝39
  • 金钱1626
  • 威望40
  • 积分2536

热门问题