Hi,

please any one help me , after installing drupal i got

Notice: unserialize() [function.unserialize]: Error at offset 2 of 21 bytes in D:\wamp\www\myod.in\includes\bootstrap.inc on line 556

please make me to solve..

Comments

shima’s picture

I have this problem too , I didn't any useful search for this problem :( anybody can't solve this?

enlianykiy’s picture

I have this problem too , I didn't any useful search for this problem :( anybody can't solve this?

shipra.drupal’s picture

This issue can be resolved by changes the PHP.ini
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING.

FranciscoLuz’s picture

Hi mate,
According to this article http://www.electrictoolbox.com/php-unserialize-e-notice/ we can not catch a Notice msg using try().
Therefore we know that when a string can not be unserialized then FALSE is returned and an E_NOTICE is issued. Having that in mind we can find out which drupal variable is causing you trouble by doing this:

* open up bootstrap.inc file and go to line 556
* add the character @ before function unserialize(), like this: $variables[$variable->name] = @unserialize($variable->value);
(@ will suppress the notice msg)
* right below line 556 add this:
if($variables[$variable->name] == false){
print_r($variable->name.'< br >');
}
Reload your webpage and you should get one or more drupal variables names at the top of your page which are false, in other worlds, those variables could not be unserialized.
* If you have more the one variable name in the list then take note of them, recover bootstrap.inc to its original state and test each one of them to find out which one is the culprit.

Hope it helps.

Drupal in the Amazon Jungle

salientknight’s picture

This works great. It shows all of the variables that return false from unserialize(). In my case the solution to making warning go way was running cron and then clearing the cache. As I understand it these errors pop up when the cache is corrupted. I found information about fixing the problem after identifying the variables and then digging for a solution. The solution was buried in a comment, so I thought I would mention it here and hopefully save someone else a little time. In other words, try clearing your cache first :)

harriska2’s picture

Is there a Drupal 7 version of this? I've just upgraded from 6-> 7 and drupal is a bit grumpy. I'd like to debug and clean it up.

Nevermind, the link above fixed it for me...

meridiandigital’s picture

Folks having this error are advised to see this node: http://drupal.org/node/1114304.

In my case it was a minor corruption in one of the ubercart variables; removing the tables worked like a charm. Alternatively, one should be able to edit the key length to satisfy the error, if table removal/replacement is inconvenient or unworkable.

This solution should also hold true for other "unserialize" or "Error at offset" errors in bootstrap.inc; just replace "43" in the example with the number in question when making the query.

bryancasler’s picture

Fantastic new module out that takes care of all these notices

http://drupal.org/project/variablecheck

ccaajj’s picture

Gives you a new Report (/admin/reports/variablecheck) that lists invalid variables, and offers to delete them.

In my case, they were all old variables related to the Zen theme, which I had tried way back when the site was in drupal 5

https://www.drupal.org/project/variablecheck