zoukankan      html  css  js  c++  java
  • Yii2高级版本复制新项目出现问题解决

    原文地址:http://www.linuxidc.com/Linux/2015-02/114116.htm

    Yii2高级版本复制新项目会遇到下面的报错信息:

    exception 'yiiaseInvalidRouteException' with message 'Unable to resolve the request "site/error".' in /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/base/Module.php:461

    Stack trace:

    #0 /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/web/ErrorHandler.php(80): yiiaseModule->runAction('site/error')

    #1 /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/base/ErrorHandler.php(95): yiiwebErrorHandler->renderException(Object(yiiwebNotFoundHttpException))

    #2 [internal function]: yiiaseErrorHandler->handleException(Object(yiiwebNotFoundHttpException))

    #3 {main}

    Previous exception:

    exception 'yiiaseInvalidRouteException' with message 'Unable to resolve the request "site/index".' in /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/base/Module.php:461

    Stack trace:

    #0 /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/web/Application.php(83): yiiaseModule->runAction('site/index', Array)

    #1 /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/base/Application.php(375): yiiwebApplication->handleRequest(Object(yiiwebRequest))

    #2 /Users/yuzhiyuan/Documents/htdocs/yii-application/mobile/web/index.php(18): yiiaseApplication->run()

    #3 {main}

    Next exception 'yiiwebNotFoundHttpException' with message 'Page not found.' in /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/web/Application.php:95

    Stack trace:

    #0 /Users/yuzhiyuan/Documents/htdocs/yii-application/vendor/yiisoft/yii2/base/Application.php(375): yiiwebApplication->handleRequest(Object(yiiwebRequest))

    #1 /Users/yuzhiyuan/Documents/htdocs/yii-application/mobile/web/index.php(18): yiiaseApplication->run()

    #2 {main}

    解决办法:

    找到commonconfigootstrap.php

    找到上面的文件,添加一个新的别名:

    Yii::setAlias('应用名', dirname(dirname(__DIR__)) . '/目录名’);

    比如:Yii::setAlias('mobile', dirname(dirname(__DIR__)) . '/mobile’);

    这样就正常显示了.

  • 相关阅读:
    SpringCloud(四)GateWay网关
    C++中的间接宏函数
    一个C++引用库的头文件预编译陷阱
    谈谈C++中的数据对齐
    在C++中实现aligned_malloc
    WPF中的DesignerProperties
    在.NET 6中使用DateOnly和TimeOnly
    在 Ubuntu 上安装 .NET SDK 或 .NET 运行时
    Microsoft Build 2021第二天
    Microsoft Build 2021大会开始后,Develop Blog一系列更新
  • 原文地址:https://www.cnblogs.com/yangbanban/p/4944626.html
Copyright © 2011-2022 走看看