Yii2 Index.php Fix After Latest Jan 12Th Update

If you have an existing Yii2 advanced app install and have done a composer update after Jan 11th - your app may be broken. To fix I changed the following line in [font="Lucida Console"]index.php[/font] for your frontend and backend:

Change following line from:




require(__DIR__ . '/../../vendor/yiisoft/yii2/yii/Yii.php');



To:




require(__DIR__ . '/../../vendor/yiisoft/yii2/Yii.php');



There are some more changes, see index.php from app templates.

After doing so delete "composer.lock", and everything except ".gitignore" from "vendor". Then do "composer install --prefer-dist".

Also need to update the console yii file. Changes are similar to the index.php.

Did not see any other change in index.php other than location of Yii.php. Will check the other options suggested above.

I also get this error on the debug page, any fix for that?


The file or directory to be published does not exist: D:\server\projects\myproject\vendor\yiisoft\yii2/debug/assets

Have you tried this?

Ah thanks, yes, it’s working again now!