Using Aerospike (v 3.8.2.3) as my PHP Session backend, I would like to store strings with null bytes.
I installed PHP client library v 3.4.8
According to documentation, it is possible to store null bytes by changing the default serializer with something that can handle such strings like igbinary.
So I installed igbinary:
~$ php -m | grep igbinary
igbinary
And here is my php.ini configuration file:
session.save_handler="aerospike"
session.save_path="sessions|sess|127.0.0.1:3000"
session.serialize_handler=igbinary
After restarting my apache service, trying to store some session data does not work…
Here is my sample PHP code:
<?php
session_start();
echo "last foo: ", $_SESSION['foo'];
$_SESSION['foo']="bar";
No error occured but data is not stored in my namespace. Here is php output after refreshing the page:
last foo:
Notice: Undefined index: foo in /var/www/index.php on line 3
If I use default serializer or another one like “wddx”, it works well:
session.save_handler="aerospike"
session.save_path="sessions|sess|127.0.0.1:3000"
session.serialize_handler=wddx
page output:
last foo: bar
Any idea on how to make igbinary work as a serializer for Aerospike?
Thanks,