Install memcache_PHP in windows

Source: Internet
Author: User
Install memcache in windows. For more information about memcache, see: What is memcached? How to use memcache? (1) to install memcache, you must first download two files. here we will not talk about the introduction of memcache by memca. for readers, refer to: What is memcached? How to use memcache?

(1) to install memcache, you must first download two Files: The memcached installation file and the pecl extension php_memcache.dll file required by php. This section describes how to install memcached in windows, so you need to download the memcached.exe file. Memcached.exe: http://code.jellycan.com/memcached/, you have to download the file named memcached-1.2.6-win32-bin.zip on this page. As for php_memcache.dll, it is not provided here. go to Baidu to search for it, because it must be the same as your php version (below are some of the more common php_memcache.dll versions ).

(2) after preparing the above tools, you can start installation and debugging. First install memcache.

Decompress the downloaded memcache file package to a disk, for example, in c: \ memcached

Enter "c: \ memcached \ memcached.exe-d install" on the terminal (that is, the cmd command interface) to install

At this time, you may not know what port your installed memcache uses. Next, modify the port to the port we specified by modifying the registry. Open the registry editor and find the ImagePath string under HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ memcached Server. double-click the string, append-l 127.0.0.1-m 45-p 51321 to the end of the project value (here, the access ip address is 127.0.0.1 with 45 m memory and 51321 is the port ), close registry editor after modification.

Enter "c: \ memcached \ memcached.exe-d start" in the command interface to start the memcache service or find the memcached service in the computer service item and restart it.

After completing the preceding operations, let's check whether the cache service memcache is successfully installed and running. Enter "telnet 127.0.0.1 51321" on the terminal, and then enter stats. if a bunch of letters similar to the following are displayed, it indicates that the memcache service has been successfully installed and runs.

STAT pid 5636
Statuptime 936
STAT time 1344915126
STAT version 1.2.6
STAT pointer_size 32
STAT curr_items 0
STAT total_items 0
STAT bytes 0
STAT curr_connections 2
STAT total_connections 3
STAT connection_structures 3
STAT performance_get 0
STAT performance_set 0
STAT get_hits 0
STAT get_misses 0
STAT evictions 0
STAT bytes_read 19
STAT bytes_written 7
STAT limit_maxbytes 67108864
STAT threads 1
END

Note: If you are a Windows 7 system, the message "'telnet 'is not an internal or external command or a program that can be run" may be displayed, after troubleshooting, this is because the telnet function is not installed by default in Win7, so you cannot directly use the telnet command, you can go to "control panel"> "program"> "enable or disable Windows" and check "telnet Client.

(3) configure PHP. Decompress the downloaded pecl module package and put php_memache.dll in the ext Directory of the php Directory (note: to prevent unexpected errors, you are advised to download the module package consistent with the php version ). Find the php. ini file, add a line in it: extension = php_memcache.dll, and restart the apache server. now the php memcache extension package has been installed.

(4) test whether memcache can work in the php environment. We can use the following code for testing:

$ Memcache_obj = new Memcache; $ memcache_obj-> connect ('192. 0.0.1 ', 127); $ memcache_obj-> set ('Var _ key', 'memcache test! ', MEMCACHE_COMPRESSED, 50); echo $ memcache_obj-> get ('Var _ key ');

If "memcache test!" is output normally !" It means that you have successfully set up the memcache service for your php environment. Note that "Class 'memcac' not found in... "Class error. this is tested because the extension package is inconsistent with your php environment. Please download another extension package that is consistent with your php environment.

Articles you may be interested in
  • Install and configure memcache in windows
  • Install and use Sphinx in windows [Chinese full-text search is supported]
  • How to accelerate windows 7 system optimization
  • How to run PHP files in the command line in windows
  • Steps for synchronizing and backing up mysql databases in windows
  • Differences between window. navigate and window. location. href
  • How to install and configure the PHP runtime environment in Windows 7
  • Win7 system slimming optimization

The introduction of memory memcache is not mentioned here. readers can refer to: What is memcached? How to use memcache? (1) to install memcache, you must first download two files: memca...

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.