Calling Unknown Method: Yii\web\urlmanager::addrules()


I’m getting this error since updat1ng Yii2 via Composer about an hour ago:

Calling unknown method: yii\web\UrlManager::addRules()

My composer.lock file

"require": {

	"php": ">=5.4.0",

	"yiisoft/yii2": "*",

	"yiisoft/yii2-bootstrap": "*",

	"yiisoft/yii2-swiftmailer": "*",

	"yiisoft/yii2-gii": "*",

	"kartik-v/yii2-nav-x": "*",		

	"amnah/yii2-user": "~2.0",

	"yiisoft/yii2-imagine": "*",

	"erusev/parsedown": "*"



PS: why can’t I write updat*ng without the forum telling me “Your post seems to be a spam.”


I have the same problem.

Already reported at github. We’re looking into it.

Same problem here!

Thanks for the effort! I’m loving yii2 FW =)

The solution was posted on Github.

Add to composer.json

"extra": {

        "asset-installer-paths": {

            "npm-asset-library": "vendor/npm",

            "bower-asset-library": "vendor/bower"



and run

# php composer.phar global require "fxp/composer-asset-plugin:1.0.*@dev"

# php composer.phar update --dev

This solution worked for me.

Me too!! is it solved or not yet??

Also I got this error at the sign up form: (Note: I’m using the advanced template)

Getting unknown property: yii\web\Application::security

Actually getSecurity() is not any more in Yii\web\Application nor in Yii\base\Application

Hi everyone!

I have solved that issue by:

Step1:composer global require "fxp/composer-asset-plugin:1.0.*@dev"

Step2:composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-advanced myproject

Step3:copy and past to composer.json at ‘require’, then run composer --prefer-dist update:

"bower-asset/jquery": "@stable",

    "bower-asset/bootstrap": "@stable",

    "bower-asset/jquery-ui": "@stable",

    "bower-asset/jquery.inputmask": "@stable",

    "bower-asset/punycode": "@stable"	

Step4:Run composer --prefer-dist update

Hope this may help you !

How to fix this error?

Invalid Parameter – yii\base\InvalidParamException

The file or directory to be published does not exist: /yii/vendor/bower/jquery/dist



refer to installation in link

composer global require "fxp/composer-asset-plugin:1.0.0-beta1" <-- required version has been updated

Check the update guide, first point:

It happens even when one creates new project right now. Is that right?

I think creating new Project should not do that?

Created new Project using

composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic

and I get error

Unknown Method – yii\base\UnknownMethodException

Calling unknown method: yii\web\UrlManager::addRules()

Any idea?

Have you installed the plugin globally before doing create-project?

No. Actually there is no hint about installing any plugin in the guide. I just ran the command. Would you explain a bit.


Update today and I get new Error

Invalid Parameter – yii\base\InvalidParamException

The file or directory to be published does not exist: /home/stefano/basic/vendor/bower/jquery/dist

yeah, It works.

thank you very much!

Thank you . i’m check on

composer global require "fxp/composer-asset-plugin:1.0.0-beta3"

It works