In the win system installation configuration Memcached for PHP 5.3 Graphics tutorial _php instance

Source: Internet
Author: User
Tags crc32 hash memcached vc9

How do I get PHP to support memcached on a Windows system?

First step: Install Memcached Service
Step two: Let php load memcached.dll extension

The following information for reference:
1. Installing Memcached for PHP 5.3 on Windows 7
2, Windows under the memcache installation configuration + did not successfully load memcached

Detailed steps are as follows:

First step: Install Memcached Service

1, download Memcached Win32 (point I download)

2, unzip the downloaded file to the custom directory, for example (C:\webserver\memcached)
After decompression, there is only one memcached.exe in the directory

3. Run command line with admin rights (CMD)

4, installation

Copy Code code as follows:

memcached-d Install

Tip: If you are prompted to MSVCP71.dll an error that does not exist, visit here (poke me)

5, start

Copy Code code as follows:

memcached-d start

6, check the installation path (can not be ignored)

Copy Code code as follows:

WMIC process get description, ExecutablePath | Findstr Memcached.exe

Show:
Memcached.exe C:\webserver\memcached\memcached.exe

Here, the memcached service is installed.

Step two: Let php load memcached.dll extension

1, download the VC9 version of the Memcached.dll
Thread safe version
Http://downloads.php.net/pierre/php_memcache-2.2.6-5.3-vc9-x86.zip
Non-threaded security version fastcgi how to run PHP
Http://downloads.php.net/pierre/php_memcache-2.2.6-5.3-nts-vc9-x86.zip

2, decompression get php_memcache.dll, and copy to PHP's extended directory C:\webserver\php5.3nts\ext

3, edit php.ini, add at its bottom

Copy Code code as follows:

[Memcache]
Extension=php_memcache.dll
A high-performance distributed Memory object caching system that maintains a unified, huge hash table in memory
It can be used to store data in a variety of formats, including images, videos, files, and the results of database retrieval.
Whether to transparently failover to other servers when an error is encountered.
Memcache.allow_failover = 0
The maximum number of servers to try when accepting and sending data, only when opening memcache.allow_failover.
Memcache.max_failover_attempts = 20
Data is transferred according to the block size set by this value. The smaller the value, the more network traffic is required.
If you find an unexplained rate decrease, you can try to increase this value to 32768.
Memcache.chunk_size = 8192
The default TCP port to use when connecting to the memcached server.
Memcache.default_port = 11211
Control the policy that maps the key to the server. The default value "Standard" represents the old hash policy using the previous version.
; set to "consistent" allows you to add/Remove servers in a connection pool without having to recalculate the mapping relationship between key and server.
Memcache.hash_strategy = "consistent"
; Controls the hash function that maps the key to the server. The default value "CRC32" uses the CRC32 algorithm, whereas "FNV" means the FNV-1A algorithm is used.
; The fnv-1a is slightly lower than the CRC32 speed, but the hash effect is better.
Memcache.hash_function = "CRC32"
, the following 2 settings see above [session]
, the token uses Memcache as the session processor when the value is Memcache
; Session.save_handler = "Files"
Define the separator symbol for each server link used for the call store, for example: "tcp://host1:11211, tcp://host2:11211"
; Each server link can contain parameters that are accepted to the server, and compare similar servers that are 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 on the command line)

Copy Code code as follows:

Iisreset/restart

At this point, the memcached configuration is complete

The above is the entire content of this article. I hope you can enjoy it.

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.