This article mainly introduces how to install and configure MemcachedforPHP5.3 on windows system. if you need it, you can refer to how to enable php to support memcached on windows system?
Step 1: install the Memcached service
Step 2: Let php load the memcached. dll extension
See the following documents:
1. Installing Memcached for PHP 5.3 on Windows 7
2. in Windows, the Memcache installation configuration + memcached is not loaded successfully
The detailed steps are as follows:
Step 1: install the Memcached service
1. download Memcached Win32 (Click here to download)
2. decompress the downloaded file to the custom directory, for example, C: \ webserver \ memcached)
After decompression, there is only one memcached.exe in this directory.
3. RUN command line (cmd) with the administrator privilege)
4. Installation
The code is as follows:
Memcached-d install
Tip: If MSVCP71.dll does not exist, visit here (stamp me)
5. start
The code is as follows:
Memcached-d start
6. check the installation path (ignore it)
The code is as follows:
Wmic process get description, executablepath | findstr memcached.exe
Display:
Memcached.exe C: \ webserver \ memcached \ memcached.exe
The memcached service has been installed.
Step 2: Let php load the memcached. dll extension
1. download memcached. dll of VC9
Thread Security Edition
Http://downloads.php.net/pierre/php_memcache-2.2.6-5.3-vc9-x86.zip
Non-thread-safe fastcgi php running method
Http://downloads.php.net/pierre/php_memcache-2.2.6-5.3-nts-vc9-x86.zip
2. decompress php_memcache.dll and copy it to the php extension directory C: \ webserver \ php5.3ets \ ext.
3. edit php. ini and add it to the bottom.
The code is as follows:
[Memcache]
Extension = php_memcache.dll
A high-performance distributed memory object cache system maintains a unified and huge hash table in the memory,
It can be used to store data in various formats, including images, videos, files, and database retrieval results.
Whether to transparently transfer data to other servers in case of errors.
Memcache. allow_failover = 0
The maximum number of servers allowed to receive and send data, which is valid only when memcache. allow_failover is enabled.
Memcache. max_failover_attempts = 20
Data will be transferred according to the block size set by this value. The smaller the value, the more extra network transmission is required.
If you find that the speed cannot be explained is reduced, you can try to increase this value to 32768.
Memcache. chunk_size = 8192
The default TCP port used to connect to the memcached server.
Memcache. default_port = 11211
Control the policy to map keys to the server. The default value "standard" indicates that the old hash policy of the previous version is used.
If it is set to "consistent", you do not have to re-calculate the ing between the key and the server when adding or deleting servers in the connection pool.
Memcache. hash_strategy = "consistent"
Control the hash function that maps keys to the server. The default value "crc32" uses the CRC32 algorithm, while "fnv" indicates that the FNV-1a algorithm is used.
; FNV-1a than CRC32 speed is slightly lower, but the hash effect is better.
Memcache. hash_function = "crc32"
For the following two settings, see [session] above.
When the value is memcache, memcache is used as the session processor.
; Session. save_handler = "files"
Define the separator number of each server link used for call storage, for example, "tcp: // host1: 11211, tcp: // host2: 11211"
Each server link can contain parameters accepted by the server, which is similar to the server added using Memcache: addServer ().
For example, "tcp: // host1: 11211? Persistent = 1 & weight = 1 & timeout = 1 & amp; retry_interval = 15"
; Session. save_path = ""
4. restart IIS (run in command line)
The code is as follows:
Iisreset/restart
Now, memcached configuration is complete.
The above is all the content of this article. I hope you will like it.