7

I am using a version of yii2 installed a few months back. Now I want it to be upgraded to the latest version.How can I know which version of Yii2 is being used and how to upgrade to the latest version of yii2?

4 Answers 4

16

Run ./yii command, you will get following output:

./yii

This is Yii version 2.0.8.

The following commands are available:

Source: https://stackoverflow.com/a/29271811/1897969

11

In console in site folder run composer update. And composer will update you Yii2.

If you want to know which version of Yii2 you are using run Yii::getVersion().

1

With regard to identifying the current version, there is a function getVersion() in vendor/yiisoft/yii2/BaseYii.php. You can simply open the file and examine the return value to see the version of the codebase you are working with.

0

I was facing the same issue with Yii version 2.0.42, PHP 7.3 particularly while login, I found that the User class extends object class while replacing that my code works fine.

namespace app\models;
class User extends \yii\base\Object implements \yii\web\IdentityInterface
{}

Replace with

namespace app\models;

class User extends \yii\base\BaseObject implements \yii\web\IdentityInterface
{  }

my issue resolve.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.