Reputation: 93
I am using the following to serialize a variable in php
$sum=30;
$a = serialize($sum);
file_put_contents('store', $a);
And in another page i am not able to get the variable by unserialize function.In my local server ,it is working fine.But when i transferred to live server,i am not able to get the unserialized variable.I am using following for unserialization,
$s = file_get_contents('store');
$a = unserialize($s);
What is the issue?
Upvotes: 1
Views: 100
Reputation: 6092
General cases are:
store
, so a live server isn't able to read a data from it.igbinary
or suhoshin
extensions? They can influence on serialization/unserialization process.is_readable('store');
Upvotes: 2