Windows system IIS environment to install memcache method

  
1, first download memcached-1.2.1-win32.zip

Download address http://download.csdn.net/detail/u011986449/8110579

This is the version under windows, the installation should be installed under the command line. The decompression room C drive or other disk can be, such as my C drive memcache121 directory, and then enter the cmd command line, as follows:

Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp.

C:\\Documents andSettings\\Administrator>cd\\

C:\\>cd memcached121

C:\\memcached121>memcached.exe -dinstall (installed as a service)

C:\\memcached121>memcached.exe -dstart (startup)

C:\\memcached121> You can see the memcache.exe process in the process. This will automatically start each time you start

2. Download the php_memcache.dll corresponding to the php version (my php version is php-5.2.9-1-Win32.zip) at http://cn.php .net/get/pecl-5.2.6-Win32.zip/from/a/mirror download pecl-5.2.6-Win32.zip here and extract it, copy the php_memcache.dll inside to your php's ext directory, like me Is the d:\\php5\\ext directory, for php to load php_memcache.dll

3, configure php.ini in C:\\windows\\php.ini add a line extension=php_memcache.dll, (location is In the

extension=php_mbstring.dll extensions, you can add it.)

4. Restart IIS, then check phpinfo, if there is memcache, then the installation is successful!

The basic settings of memcached:

-p The port to listen to -l The IP address of the connection, the default is the local machine -d start Start the memcached service -d restart Restart the memcached service -d stop| Shutdown Shut down the running memcached service -d install Install the memcached service -d uninstall Uninstall the memcached service -u Run as follows (only valid when running as root) -m Maximum memory usage, in megabytes. The default 64MB -M returns an error when the memory is exhausted, instead of deleting the item -c maximum simultaneous connection number, the default is 1024 -f block size growth factor, the default is 1.25 -n minimum allocation space, key+value+flags default is 48 - h Display help

Memcache environment test: Run the following php file, if there is output This is a test!, it means the environment is set up successfully. 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!& rsquo;, 0, 60); $val = $mem->get(’key’);echo $val;?>
Copyright © Windows knowledge All Rights Reserved