没有不值得去解决的问题,也没有不值得去学习的技术!

Fixing the PHP Notice: unserialize() — Unexpected End of Serialized Data in PHP 7.1.12 and Yii Framework/1.1.16

Error: unserialize(): Unexpected end of serialized data

1. Error: unserialize(): Unexpected end of serialized data, as shown in Figure 1

Error: unserialize(): Unexpected end of serialized data
Figure 1

2. Edit \framework\caching\CCache.php and print out $value, as shown in Figure 2

Edit \framework\caching\CCache.php and print out $value
Figure 2

3. The printed result has the value: }, as shown in Figure 3

The printed result has the value: }
Figure 3

4. Edit \framework\web\CUrlManager.php and print out self::CACHE_KEY, as shown in Figure 4

Edit \framework\web\CUrlManager.php and print out self::CACHE_KEY
Figure 4

5. The printed result has the value: Yii.CUrlManager.rules, as shown in Figure 5

The printed result has the value: Yii.CUrlManager.rules
Figure 5

6. Open the URL: https://github.com/yiisoft/yii/issues/4137, and you will find the same issue, as shown in Figure 6

Open the URL: https://github.com/yiisoft/yii/issues/4137, and you will find the same issue
Figure 6

7. Following the issue resolution instructions, upgrade Yii Framework to 1.1.19, as shown in Figure 7

Following the issue resolution instructions, upgrade Yii Framework to 1.1.19
Figure 7

8. Delete the framework directory in the program, and copy the downloaded framework directory into the program, as shown in Figure 8

Delete the framework directory in the program, and copy the downloaded framework directory into the program
Figure 8

9. After the upgrade, the issue is resolved.

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系