Laravel 4-unserialize():32个字节的偏移量0处出错 [英] Laravel 4 - unserialize(): Error at offset 0 of 32 bytes
问题描述
当我安装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!
推荐答案
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屋!