Installing Memcache extensions for PHP5.6.14 under Windows 64-bit

Source: Internet
Author: User
Tags phpinfo

1. To use PHP to connect to the memcached server, you need to introduce the corresponding Php-memcache.dll extension, you need to note that in Windows to find the corresponding DLL extension to be very cautious, generally consider the following points: (see PHPINFO)

1. PHP version

2, TS or NTS (thread safety or unsafe)

3, compile is VC6 or VC9

I have chosen this version:

http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/8E/A9/wKioL1jIucPRvd7oAACtBztAyCo683.png-wh_500x0-wm_ 3-wmp_4-s_4273698136.png "title=" qq picture 20170315114701.png "alt=" Wkiol1jiucprvd7oaactbztayco683.png-wh_50 "/>

Then put the inside of the Php_memcache.dll into the Php/ext, and in the corresponding server PHP.ini configuration (F:\wamp\bin\apache\Apache2.4.4\bin\php.ini) to join EXTENSION=PHP_ Memcache.dll. Restart the server.

2. Download the Memcache service

Http://vdisk.weibo.com/s/dwoxtoBQDYzjm

Execute it in the Memcache.exe path in cmd, I put it on the D drive.

Memcached-m 64-p 11211-VVV

650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M00/8E/A9/wKioL1jIuqui0sqLAAFlXf3UP8Y785.png-wh_500x0-wm_ 3-wmp_4-s_1241856577.png "title=" qq picture 20170315115014.png "alt=" Wkiol1jiuqui0sqlaaflxf3up8y785.png-wh_50 "/>

3. Test Memcache

http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/

The files downloaded in this address are also available as examples for testing

<?php
/**
* @file test11.php
* @author Linlin
* @date March 14, 2017 2:56:21
* @brief
*/
/* echo phpinfo (); exit; */

$memcache = Memcache_connect (' localhost ', 11211);

if ($memcache) {
$memcache->set ("Str_key", "String to store in memcached");
$memcache->set ("Num_key", 123);

$object = new StdClass;
$object->attribute = ' Test ';
$memcache->set ("Obj_key", $object);

$array = Array (' Assoc ' =>123, 345, 567);
$memcache->set ("Arr_key", $array);

Var_dump ($memcache->get (' Str_key '));
Var_dump ($memcache->get (' Num_key '));
Var_dump ($memcache->get (' Obj_key '));
Var_dump ($memcache->get (' Arr_key '));
}
else {
echo "Connection to memcached failed";
}

Final Test success

This article is from "The only way to program" blog, please be sure to keep this source http://linlin2017.blog.51cto.com/8346821/1906780

Installing Memcache extensions for PHP5.6.14 under Windows 64-bit

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.