YII2 errors encountered in installation calling unknown Method:yii\web\urlmanager::addrules ()

Source: Internet
Author: User
Tags yii

After installing the YII2, it appears as an error prompt:


Here's how to fix it:

Open the Installed YII2 project directory (YII2 installation method see the blog of the Sky Star: http://blog.csdn.net/zqtsx/article/details/39344913)

Open the Composer.json file in the YII2 project directory (for example)


Add the following code in the Composer.json file (extra brackets):


The modified Composer.json file is roughly the following (the new code we added to the extra section):

{"Name": "yiisoft/yii2-app-advanced", "description": "Yii 2 Advanced Application Template", "keywords": ["Yii2",    "Framework", "Advanced", "Application Template"], "homepage": "http://www.yiiframework.com/", "type": "Project", "License": "Bsd-3-clause", "support": {"Issues": "Https://github.com/yiisoft/yii2/issues?state=open", " Forum ":" http://www.yiiframework.com/forum/"," wiki ":" http://www.yiiframework.com/wiki/"," IRC ":" Irc://irc . Freenode.net/yii "," source ":" Https://github.com/yiisoft/yii2 "}," minimum-stability ":" Dev "," Require ": {"PHP": ">=5.4.0", "Yiisoft/yii2": "*", "yiisoft/yii2-bootstrap": "*", "yiisoft/yii2-swift Mailer ":" * "}," Require-dev ": {" yiisoft/yii2-codeception ":" * "," yiisoft/yii2-debug ":" * "," Y Iisoft/yii2-gii ":" * "," Yiisoft/yii2-faker ":" * "}," config ": {" process-timeout ": 1800}," Extr A ": {" Asset-instAller-paths ": {" npm-asset-library ":" VENDOR/NPM "," bower-asset-library ":" Vendor/bower "," Npm-se Archable ": false," bower-searchable ": false}}}
Then open the command line to switch to YII2 's project directory (non-frame directory):

Execute the following command in turn:

composer global require "fxp/composer-asset-plugin:1.0.* @dev "
composer Update   (if not the second step, please execute " composer update--dev--try-run "command, General composer update )

Appear as shown below please be patient and wait for the download of the update file:



By the end of this update,

Open the browser again to enter the project address http://127.0.0.2/frontend/web/to detect if the project is back to normal:



YII2 errors encountered in installation calling unknown Method:yii\web\urlmanager::addrules ()

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.