Install Memcache in Windows

Source: Internet
Author: User
Many phper do not know how to set up a Memcache development and debugging environment in Windows. Recently, I am also studying Memcache and recording the process of installing and setting up Memcache in Windows. Many phper do not know how to set up a Memcache development and debugging environment in Windows. Recently, I am also studying Memcache and recording the process of installing and setting up Memcache in Windows. (Detailed steps for installing and starting memcache in Linux)

In fact, when I started to study Memcache, I didn't know that there was a memcached for Win32 bird thing, which caused me to be able to handle it in a one-day way in the case of CEN-tos, today, I suddenly found that there is no problem in developing and debugging Memcache in Windows, so I wrote a Memcache document to share with you.

Install Memcache in Windows:

1. download the stable version of memcache for windows and decompress it to a disk, for example, in c: \ memcached

2. enter 'C: \ memcached \ memcached.exe-d install' on the terminal (that is, the cmd command interface) to install

3. enter 'C: \ memcached \ memcached.exe-d start' to start. NOTE: In the future, memcached will be used as a windows service and will be automatically started every time it is started. In this way, the server has been installed.

4. download php_memcache.dll. find the corresponding php version file by yourself.

5. add a line 'extension = php_memcache.dll 'to C: \ winnt \ php. ini'

6. restart Apache and check phpinfo. if memcache exists, the installation is successful!

Basic settings of memcached:

-P listening port-l connection IP address, the default value is local-d start to start memcached service-d restart to restart memcached service-d stop | shutdown to disable the running memcached service-d install to install memcached service-d uninstall to uninstall memcached service-u run as (only valid when running as root) -MB maximum memory usage, in MB. An error is returned when 64 MB-M memory is used up by default, instead of deleting the maximum number of concurrent connections in item-c. the default value is 1024-f. The default value is 1.25-n, key + value + flags the default value is 48-h.

Test the Memcache environment:

Run the following php file. if This is a test! is output !, Indicates that the environment is successfully set up. Start to appreciate the charm of Memcache!

< ?php$mem = new Memcache;$mem->connect("127.0.0.1", 11211);$mem->set('key', 'This is a test!', 0, 60);$val = $mem->get('key');echo $val;?>

The above is a detailed tutorial on installing Memcache in Windows. For more information, see other related articles in the first PHP community!

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.