Added Memcache module for Ubuntu + lampp Extension

Source: Internet
Author: User
Tags crc32
I checked some installation methods on the Internet and tried it. Ubuntu does not support XAMPP. So start to try a new installation method: first install memcache and php5memcache module sudoapt-getinstallmemcachedphp5-memcache copy the generated file to the location where the LAMPP is stored: cp/usr/lib/php5/20090626 + lfs/memcache. so/opt/lampp/lib/

I checked some installation methods on the Internet and tried it. Ubuntu does not support XAMPP.
Then try the new installation method:
First install memcache and php5 memcache module sudo apt-get install memcached php5-memcache
Copy the generated file to the location where LAMPP is stored:
Cp/usr/lib/php5/20090626 + lfs/memcache. so/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/memcache. so
Configure/opt/lampp/etc/php. ini
Extension = memcache. so
[Memcache]
Memcache. dbpath = "/var/lib/memcache"
Memcache. maxreclevel = 0
Memcache. maxfiles = 0
Memcache. archivememlim = 0
Memcache. maxfilesize = 0
Memcache. maxratio = 0


Restart LAMPP
PHPINFO:

Memcache

Memcache support Enabled
Version 3.0.4
Revision $ Revision: 1.83.2.36 $

Directive Local Value Master Value
Memcache. allow_failover 1 1
Memcache. chunk_size 32768 32768
Memcache. compress_threshold 20000 20000
Memcache. default_port 11211 11211
Memcache. hash_function Crc32 Crc32
Memcache. hash_strategy Consistent Consistent
Memcache. lock_timeout 15 15
Memcache. max_failover_attempts 20 20
Memcache. protocol Ascii Ascii
Memcache. redundancy 1 1
Memcache. session_redundancy 2 2

Run the memcache memory, port, and running user sudo memcached-d-m 50-p 11211-u root
Parameter description-m specifies the number of MB of cache space used;
-P: Specifies the port to be listened on;
-U specifies which user to run here is only a test case. To ensure security, you can also set other users to run the Memcache configuration file in/etc/php5/conf. d/memcache. ini is used for testing and is not configured.
Code to test whether memcache is successful:
$ Mem-> connect ("127.0.0.1", 11211 );
$ Mem-> set ('key', 'This is a memcached test! ', 0, 60 );
$ Val = $ mem-> get ('key ');
Echo $ val;
?>

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.