Win7 under 64-bit system memcache/memcached installation Tutorial

Source: Internet
Author: User

Similar to the previous article Xdebug installation Tutorial ~ ~

The difference between memcache and memcached in their new program is intended to fully apply memcached technology, which is easy to understand this is the memcached is the memory cache, but how do you still have memcache? Actually very simple, memcache is an extension of PHP, for PHP management Memcached,php-memcache.dll. If the installation of memcached does not install the extension, then PHP will not be able to control the memcached, but the command is not a problem to use the implementation of the memcache extension but did not install the memcached service, then this cannot be used You can use memcached in PHP to improve dynamic site performance only if you have both the memcached service and the memcache extension installed

One, install memcache PHP extension 1. Php_memcache.dll Download:: Php_memcache.zip http://www.2cto.com/uploadfile/2012/0713/20120713110240777.zip

2. Place the Php_memcache.dll in the PHP ext directory: For example: D:\WampServer\bin\php\php5.3.11\ext\php_memcache.dll3. Open a. php.ini file: My php.ini location: D:\WampServer\bin\php\php5.3.11\php.ini4. Add a line on php.ini: Extension=php_memcache.dll 5. Restart Wampserver Apache Service II, install memcached 1. Memcached-win64 Download: A. Download the latest version: Http://blog.couchbase.com/memcached-windows-64-bit-pre-release-available B. Direct download: Memcached-win64-1.4.4-14.zip
Http://www.2cto.com/uploadfile/2012/0713/20120713110308123.zip

2. Unzip and place under a disk, for example: D:\WampServer\bin\memcached\memcached.exe 3. Under Terminal (also known as cmd Command Interface), enter the following command to install the Windows service: D:\wampserver\bin\memcached>memcached.exe-d installation 4. Then enter the following command to start: d:\wampserver\bin\memcached>memcached.exe-d start
Ok~~ finished opening the Phpinfo () page:

=========== Code Test =============

01 $memcachenewMemcache;
02 $memcache->connect("localhost",11211); # You might need to set "localhost"to "127.0.0.1"
03
04 echo"Server‘s version: "$memcache->getVersion() . "\n";
05
06 $tmp_objectnewstdClass;
07 $tmp_object->str_attr = "test";
08 $tmp_object->int_attr = 123;
09
10 $memcache->set("key",$tmp_object,false,10);
11 echo"Store data in the cache (data will expire in 10 seconds)\n";
12
13 echo"Data from the cache:\n";
14 var_dump($memcache->get("key"));

Results:

View Source print?
01 ---------- PhpUnit ----------
02 Server‘s version: 1.4.4-14-g9c660c0
03 Store data inthe cache (data will expire in10 seconds)
04 Data from the cache:
05 object(stdClass)#3 (2) {
06   ["str_attr"]=>
07   string(4) "test"
08   ["int_attr"]=>
09   int(123)
10 }
11
12 Output completed (2 sec consumed) - Normal Termination

Win7 under 64-bit system memcache/memcached installation Tutorial

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.