YII2 Advanced version replication new project problem Resolution (GO)

Source: Internet
Author: User

Reference to Http://www.linuxidc.com/Linux/2015-02/114116.htm

YII2 Advanced version replication new items will encounter the following error message:

Exception ' yii\base\invalidrouteexception ' 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: yii\base\ Module->runaction (' Site/error ')
#1/users/yuzhiyuan/documents/htdocs/yii-application/vendor/yiisoft/yii2/base/errorhandler.php (): 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 ' 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 (yii\base\): Module->runaction (' Site/index ', Array)
#1/users/yuzhiyuan/documents/htdocs/yii-application/vendor/yiisoft/yii2/base/application.php (375): Yii\web\ Application->handlerequest (Object (yii\web\request))
#2/users/yuzhiyuan/documents/htdocs/yii-application/mobile/web/index.php: Yii\base\application->run ()
#3 {main}


Next exception ' yii\web\notfoundhttpexception ' 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): Yii\web\ Application->handlerequest (Object (yii\web\request))
#1/users/yuzhiyuan/documents/htdocs/yii-application/mobile/web/index.php: Yii\base\application->run ()
#2 {main}

Workaround:

Find common\config\bootstrap.php

Locate the file above and add a new alias:
Yii::setalias (' Application name ', DirName (dirname (__dir__)). '/directory name ');
For example: Yii::setalias (' Mobile ', DirName (dirname (__dir__)). '/mobile ');

YII2 Advanced version replication new project problem Resolution (GO)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.