Install Memcache under Windows 7 and Wamp server

Source: Internet
Author: User

1. Installing the PHP memcache extension1). Download memcache extension Https://pecl.php.net/package/memcache Note: A. x86 or 64 bit depends on version B of Wamp server. PHP version 2). Copy to ext directory copy php_memcache.dll to ext directory 3). Modify php.ini add Extension=php_memcache.dll4). Restart Apache Service 2. Installing the Memcached service1). Download memcachedhttp://blog.couchbase.com/memcached-windows-64-bit-pre-release-available2). Install memcached Service A. Unzip the downloaded file to wamp/bin/memcached B. Run cmd.exec with the system administrator. Under Wamp/bin/memcached, run memcached-d installd. Start the service memcached-d start3). Test code
<?PHPHeader("Content-type:text/html;charset=utf-8");$memcache=NewMemcache;$memcache->connect ("127.0.0.1", 11211);Echo"Server S version:".$memcache->getversion (). "<br/>";$data=Array(    ' url ' = ' http://iw3c.com ', ' name ' = ' The Tribe of ' Aries ');$memcache->set ("Key",$data, 0,10);EchoThe Store data in the cache (data would expire in seconds) <br/> ";Echo"Data from the cache:<br/>";Var_dump($memcache->get ("key"));

watch out. 1. Installing the Memcached service requires Cmd.exe to run 2 with the system administrator. Although it is a 64-bit system, WAMP is not necessarily a 64-bit

Install Memcache under Windows 7 and Wamp server

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.