PHP cannot read Perl serialized objects stored in memcached.

Source: Internet
Author: User

The client serialization object of Perl memcached adopts the nfreeze method of the storable module, which calls the C extended do_store method. The deserialization uses the thaw method of the storable module, this method is the do_retrieve method of the c extension called.

In PHP, The serialize and unserialize operations are performed. Results that cannot be normally read.

Perl stores references to an array ('A', 'C,

The command line returns the following results:

You can use the binary editor to view the storage results as follows:

In PHP, The memcache client gzuncompress and unserialize functions can obtain the stored data and print it out, as shown in:

The result is the same as that shown in the preceding binary editor.

 

Memcached official documentation: http://code.google.com/p/memcached/wiki/FAQ

As mentioned in

We can see that accessing memcached from clients in different languages is caused by Object serialization.AlgorithmInconsistency, resulting in Direct Reading and parsing.

A better solution is to store and read data using common formats such as JSON and yaml, call services, or use cross-language platforms such as thrift and gearman.

But is there any way to directly access existing data?

 

Perl can be installed in PHP serialize and unserialize in Perl module to achieve the same serialization as PHP, the specific solution to participate in the peak of the blog: http://www.jeftom.com /? P = 212 # respond.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.