New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning: Erroneous data format for unserializing PHP 5.4.29 and 5.5.13 #11056
Comments
This is a Doctrine issue, not a Symfony issue. And this is already fixed in the dev version of Doctrine |
Same error with PHP Version 5.6.0beta4 To fix it add : || PHP_VERSION_ID === 50600
|
I have the same error with Symfony 2.3 on PHP V5.6 |
Make sure you use correct PHP_VERSION_ID value :) |
Still exists on doctrine 2.5.0+ and PHP5.6+ |
@nask0 funny, i was looking for the error message to see if i could do something about it , and google lend me to that page ... |
I had the same error message on Symfony 2.3 and 2.7 using Doctrine ORM 2.3. I'm using PHP 5.6.4-4ubuntu6. I solved this problem by upgrading Doctrine ORM to 2.4.* |
@anteriovieira Fala inglês por favor (Speak English please) ;) |
@anteriovieira : do you mean that 2.5 does not work, but sticking on 2.4.* works ? |
Good morning my friend @allan-simon, in version 2.5 work. I'm using my composer as follows: //...
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
//... |
@anteriovieira , ok i'm gonna try that, thanks. |
@anteriovieira 's fix works perfect for me! Obrigado! ;-) |
@anteriovieira |
I've upgraded the composer.lock of my project recently and now it works. |
Another thanks to @anteriovieira, that version setting saved my bacon. |
Thanks for the acknowledgments, but all credit is for @timonf .
|
The "PHP_VERSION_ID" fix is just ridiculous as some of symfony developers (sorry, no mean to offend anybody). |
Thank, i updated doctrine, in composer.json "doctrine/orm": "~2.4" and after composer update |
who's more new? I use Symfony 3.1 and get this error. Windows 7 64x, PHP 5.6. How can I solve it? |
i khow this it an old topic, but i solve it with this |
The patch proposed @8khan and @oopen still work fine. If you directly want to patch against any PHP version greated than PHP 5.4, you can (more radically) do: public function newInstance()
{
if ($this->_prototype === null) {
if (PHP_VERSION_ID > 50429) {
$this->_prototype = $this->reflClass->newInstanceWithoutConstructor();
} else {
$this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
}
}
return clone $this->_prototype;
} (Important part is |
@MonsieurV yes thats a correct way to patch the issue, thanks |
When using PHP Version 5.4.29 or 5.5.13 there is an Warning, which is followed by an Fatal error due to the Object expected is false.
Original Function "newInstance" in \vendor\doctrine\orm\lib\Doctrine\ORM\Mapping\ClassMetadataInfo looks like this:
Quickfix for this issues:
See also:
doctrine/orm#1045
http://www.doctrine-project.org/jira/browse/DDC-3120
http://stackoverflow.com/questions/24031048/fos-userbundle-unable-to-login/24035854#24035854
The text was updated successfully, but these errors were encountered: