Laravel 4-unserialize():32个字节的偏移量0处出错 [英] Laravel 4 - unserialize(): Error at offset 0 of 32 bytes

查看:358
本文介绍了Laravel 4-unserialize():32个字节的偏移量0处出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我安装Laravel 4时,出现此错误:

When I install Laravel 4, I receive this error:

ErrorException
unserialize(): Error at offset 0 of 32 bytes

C:\xampp\htdocs\blog\laravel\bootstrap\compiled.php
return unserialize($this->stripPadding($this->mcryptDecrypt($value, $iv)));

如果我修改返回内容,如下所示:

If I modify return like this:

return unserialize(base64_decode($this->stripPadding($this->mcryptDecrypt($value, $iv))));

然后错误消失了.但是当然,每次我运行composer update时,此更改都将被撤消.

Then the error goes away. But of course every time I run composer update this change will be undone.

这个问题可能是什么原因?

What could be the reason of this problem?

感谢您的帮助.

更新:仅当我使用Auth :: check()时才会发生这种情况.

Update: This only happens when I use Auth::check().

更新2:现在,仅在删除base64_decode()的情况下才能使用.就像xampp的安装已经具有自我意识一样.耶稣!

Update 2: Now it only works with base64_decode() removed. It's like if the xampp installation has become self-aware. Jesus!

推荐答案

请参阅此问题:原因是加密机制发生了变化.我的解决方案是清空缓存在storage文件夹中的sessionsviews,然后运行php artisan key:generate并重新启动服务器.我不确定过程的哪一部分解决了该问题,但此后我再也没有看到它.

A change in the encryption mechanism is the cause. My solution was to empty out the sessions and views that were cached in the storage folder, then run php artisan key:generate and relaunch the server. I'm not sure which part of the process fixed the issue, but I haven't seen it since.

这篇关于Laravel 4-unserialize():32个字节的偏移量0处出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆